Ejemplo n.º 1
0
 public DsMaster.USERINFODataTable CheckLoginDetails(string username, string password)
 {
     
     var ta = new DsMasterTableAdapters.USERINFOTableAdapter {Connection = {ConnectionString = _constr}};
     var ds = new DsMaster().USERINFO;
     ta.FillByLogin(ds, username, password);
     return ds;
 }
Ejemplo n.º 2
0
 public string GetUserNameByUserid(int userid){
     var ta = new DsMasterTableAdapters.USERINFOTableAdapter {Connection = {ConnectionString = _constr}};
     var ds = new DsMaster().USERINFO;
     return ta.GetNameByUserid(userid).ToString();
 }
Ejemplo n.º 3
0
 public DsMaster.USERINFODataTable GetUserinfoByUserName(string username)
 {
     var ta = new DsMasterTableAdapters.USERINFOTableAdapter {Connection = {ConnectionString = _constr}};
     var ds = new DsMaster().USERINFO;
     ta.FillByUSERNAME(ds, username);
     return ds;
 }
Ejemplo n.º 4
0
 public DsMaster.USERINFODataTable GetUserinfoByEmp(string empno)
 {
     var ta = new DsMasterTableAdapters.USERINFOTableAdapter {Connection = {ConnectionString = _constr}};
     var ds = new DsMaster().USERINFO;
     ta.FillByEMPNO(ds, empno);
     return ds;
 }
Ejemplo n.º 5
0
 public DsMaster.USERINFODataTable GetUserInfo(bool useconstr = false, string newconstr = "p")
 {
     var ta = new DsMasterTableAdapters.USERINFOTableAdapter { Connection = { ConnectionString = useconstr ? newconstr : _constr } };
     var ds = new DsMaster().USERINFO;
     ta.Fill(ds);
     return ds;
 }
Ejemplo n.º 6
0
 public string DoSave()
 {
     string retval;
     //  SqlTransaction tran = null;
     try
     {
         var cn = new SqlConnection {ConnectionString = _constr};
         cn.Open();
         //tran = cn.BeginTransaction(IsolationLevel.ReadUncommitted);
         var dt = new DsMaster().USERINFO;
         bool isnew = false;
         var ta = new DsMasterTableAdapters.USERINFOTableAdapter() {Connection = cn};
         ta.Fill(dt);
         //ta.AssignConnection(cn, tran);
         var dr = dt.FindByUSERID(userinfoRow.USERID);
         if (dr != null)
         {
             dr.BeginEdit();
             dr.EDATE = System.DateTime.Now.Date;
             dr.EDITEDBY = Utils.Userid;
         }
         else
         {
             dr = (DsMaster.USERINFORow) dt.NewRow();
             isnew = true;
             dr.CREATEDBY = Utils.Userid;
             dr.CDATE = System.DateTime.Now.Date;
         }
         dr.USERNAME = userinfoRow.USERNAME;
         dr.FULLNAME = userinfoRow.FULLNAME;
         dr.EMPNO = userinfoRow.EMPNO;
         dr.PASSWORD = userinfoRow.PASSWORD;
         dr.ACTIVE = userinfoRow.ACTIVE;
         dr.PROFILEID = userinfoRow.PROFILEID;
         dr.USERTYPE = userinfoRow.USERTYPE;
         if (isnew)
         {
             dt.Rows.Add(dr);
             ta.Update(dt);
         }
         else
         {
             dr.EndEdit();
             ta.Update(dt);
         }
         //Utils.NewUserid
         retval = "1";
     }
     catch (Exception ex)
     {
         retval = ex.ToString();
         // if (tran != null) tran.Rollback();
     }
     return retval;
 }