using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for Class_tblUser
/// </summary>
public class Class_tblUser
{
    private String Str_UserName = String.Empty;
    private String Str_Password = String.Empty;
    private int int_UserTypeID = 0;
    private String Str_Email = String.Empty;
    private String Str_WebSite = String.Empty;
    private String Str_Phone = String.Empty;
    private String Str_Mobail = String.Empty;
    private String Str_Note = String.Empty;
    private String Str_Name = String.Empty;
    private String Str_Family = String.Empty;
    private int int_CompanyUnitID = 0;
    private Boolean Bln_UserIsActive = false;

    public Class_tblUser(String Str_UserName, String Str_Password, int int_UserTypeID, String Str_Email, String Str_WebSite, String Str_Phone, String Str_Mobail, String Str_Note, String Str_Name, String Str_Family, int int_CompanyUnitID, Boolean Bln_UserIsActive)
    {
        this.Str_UserName = Str_UserName;
        this.Str_Password = Str_Password;
        this.int_UserTypeID = int_UserTypeID;
        this.Str_Email = Str_Email;
        this.Str_WebSite = Str_WebSite;
        this.Str_Phone = Str_Phone;
        this.Str_Mobail = Str_Mobail;
        this.Str_Note = Str_Note;
        this.Str_Name = Str_Name;
        this.Str_Family = Str_Family;
        this.int_CompanyUnitID = int_CompanyUnitID;
        this.Bln_UserIsActive = Bln_UserIsActive;

    }
    //متد برای ثبت نام کاربر جدید
    public void UDF_SaveUsers()
    {


        LSC_WareHouseDataContext db = new LSC_WareHouseDataContext();

        tblUser user = new tblUser();

        Class_ShamsiTools shamsi = new Class_ShamsiTools();
        shamsi.UDF_GetCurrentShamsiDate();

        user.UserName = Str_UserName;
        user.UsersPswa = Str_Password;
        user.UserTypeID = int_UserTypeID;
        user.RegDateSH = shamsi.CurrentShmasiDate;
        user.RegDateDt = DateTime.Now;
        user.EmailOfUser = Str_Email;
        user.WebSiteOfUser = Str_WebSite;
        user.PhonesOfUser = Str_Phone;
        user.MobilesOfUser = Str_Mobail;
        user.NotesDesc = Str_Note;
        user.NameOfUser = Str_Name;
        user.SnameOfUser = Str_Family;
        user.CompanyUnitID = int_CompanyUnitID;
        user.UserIsActive = Bln_UserIsActive;

        db.tblUsers.InsertOnSubmit(user);
        db.SubmitChanges();
    }
}

