public int GetDoctorLogin() { var ta = new DsMasterTableAdapters.DOCTORSESSIONTableAdapter() {Connection = {ConnectionString = _constr}}; var ret = ta.GetActiveDoctor() ?? 0; return (int) ret; }
public void DoSave(int USERID, int UTYPE) { var ta = new DsMasterTableAdapters.DOCTORSESSIONTableAdapter() {Connection = {ConnectionString = _constr}}; var ds = new DsMaster().DOCTORSESSION; // ta.Fill(ds); //if(ds.Rows.Count == 0 ) //{ // ta.Insert(USERID, UTYPE, DateTime.Now.Date, true); //} //else //{ // foreach (DataRow d in ds.Rows) // { // d["USERID"] = USERID; // d["UTYPE"] = UTYPE; // d["UDATE"] = DateTime.Now.Date; // d["ISACTIVE"] = true; // ta.Update(d); // } //} ta.Logout(); ta.Insert(USERID, UTYPE, DateTime.Now.Date, true); }