public int Insert(Center aCenter) { string query = "insert into center_tbl values ('" + aCenter.Name + "','" + aCenter.Code + "','" + Encrypt(aCenter.Password) + "','" + aCenter.ThanaId + "')"; SqlConnection aConnection = new SqlConnection(conncetionStr); SqlCommand aCommand = new SqlCommand(query, aConnection); aConnection.Open(); int rowAffect = aCommand.ExecuteNonQuery(); aConnection.Close(); return rowAffect; }
public string Insert(Center aCenter) { if (aCenter.Name == "") { return "Enter A Center Name"; } else if (aCenterGateway.Cheak(aCenter.Name,aCenter.ThanaId)==true) { return "Already Exist "; } else if (aCenterGateway.Insert(aCenter) > 0) return "Saved"; else return "Try Again"; }
protected void loginButton_Click(object sender, EventArgs e) { Center aCenter = new Center(); aCenter.Code = codeTextBox.Text; aCenter.Password = passwordTextBox.Text; if (aCenter.Password == "") massegeLabel.Text = "Error"; massegeLabel.Text = aCenter.Password; if (aCenterManager.AuthenticateCenterLogin(aCenter.Code, aCenter.Password) == true) { //massegeLabel.Text = ""; Session["center_code"] = aCenter.Code; Session["center_id"] = aCenterManager.GetCenterId(aCenter.Code, 1); Response.Redirect("CenterUI/DoctorEntryUI.aspx"); } else { massegeLabel.Text = "Incorrect Center Code OR password"; } }