void SetNavigation() { ds = ClsGetData.GetEmployees(); Bsnav.DataSource = ds; if (Bsnav.Count == 0) { MovePrevEnable = false; MoveNextEnable = false; } else { Bsnav.MoveLast(); MoveNextEnable = false; } }
void DoSave(int op) { if (!UserinfoHasErrors()) return; var dt = new DsMaster.USERINFODataTable(); var dr = (DsMaster.USERINFORow) dt.NewRow(); dr.USERID = Empid; dr.EMPNO = txtEmpno.EditValue.ToString().ToUpper(); dr.USERNAME = txtLoginname.EditValue.ToString().ToUpper(); dr.FULLNAME = txtFullname.EditValue.ToString(); dr.PASSWORD = Functions.Base64Encode(txtPassword.EditValue.ToString()); dr.USERTYPE = cmbRole.SelectedIndex; dr.PROFILEID = cmbProfile.EditValue == null ? 0:int.Parse(cmbProfile.EditValue.ToString()); dr.ACTIVE = checkEdit1.Checked; var bl = new BLUserinfo(); bl.UserinfoRow = dr; try { var ret = bl.DoSave(); if (ret == "1") { //Empid = bl.Newuserid; XtraMessageBox.Show("Data Saved", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information); SetNavigation(); DoNew(); } if(op==1 && ret=="1") { Dispose(); } //if (op == 1 && ret == "2") //{ // DoNew(); //} } catch(Exception ex) { XtraMessageBox.Show(ex.ToString(), "POS", MessageBoxButtons.YesNo, MessageBoxIcon.Error); } }