protected void BtnInsert_Click(Object sender, System.EventArgs e) { ClAgreement cl = new ClAgreement(); cl = Data; int t = 0; if (CSharp.PublicFunction.ModeInsert(AgreementID.ToString())) { t = AgreementClass.insert(cl); } else { t = AgreementClass.Update(cl); } if (t == 0) { LblMsg.ForeColor = System.Drawing.Color.Red; CSharp.Utility.ShowMsg(Page, CSharp.ProPertyData.MsgType.warning, "خطا در ثبت"); // LblMsg.Text = ""; } else { LblMsg.ForeColor = System.Drawing.Color.Green; CSharp.Utility.ShowMsg(Page, CSharp.ProPertyData.MsgType.General_Success, "ثبت انجام شد"); LblMsg.Text = "ثبت انجام شد."; BindGrid(); } LightBox.Value = "0"; LblParamAgreementID.Text = "0"; }
private void BindPeyman(string i = "0") { ClPeyman cl = new ClPeyman(); if (Request.QueryString["aid"] != "") { ClAgreement CL2 = new ClAgreement(); CL2.AgreementID = Convert.ToInt32(Request.QueryString["aid"]); DataSet DSSS = AgreementClass.GetList(CL2); DDPeymanSelect.DataSource = PeymanClass.GetList(cl); DDPeymanSelect.DataTextField = "PeymanName"; DDPeymanSelect.DataValueField = "PeymanID"; DDPeymanSelect.DataBind(); } else { cl.PeymanID = 0; DDPeymanSelect.DataSource = PeymanClass.GetList(cl); DDPeymanSelect.DataTextField = "PeymanName"; DDPeymanSelect.DataValueField = "PeymanID"; DDPeymanSelect.DataBind(); } DDPeymanSelect.Items.Insert(0, new ListItem("پیش فرض", "0")); }
private void BindPeyman2() { ClPeyman cl = new ClPeyman(); DataSet ds = PeymanClass.GetList(cl); ddPeyman.DataSource = ds; ddPeyman.DataTextField = "PeymanName"; ddPeyman.DataValueField = "PeymanID"; ddPeyman.DataBind(); if (ddagree.SelectedValue != "0") { //ClPeymanPark cl2 = new ClPeymanPark(); //cl2.AgreementID = Convert.ToInt32(ddPeyman.SelectedValue); //DataSet ds2 = PeymanParkClass.GetList(cl2); //ddPeyman2.SelectedValue = ds2.Tables[0].Rows[0]["PeymanID"].ToString(); //ddPeyman2.Enabled = false; ClAgreement cl2 = new ClAgreement(); cl2.AgreementID = Convert.ToInt32(ddagree.SelectedValue); DataSet ds2 = AgreementClass.GetList(cl2); if (ds2.Tables[0].Rows.Count > 0) { ddPeyman.SelectedValue = ds2.Tables[0].Rows[0]["PeymanID"].ToString(); } ddPeyman.Enabled = false; } else { ddPeyman.Enabled = true; } }
public void BindGrid() { ClAgreement cl = new ClAgreement(); cl.FromDateReport = DateConvert.sh2m(CtlFromDate.Text).ToString(); cl.ToDateReport = DateConvert.sh2m(CtlToDate.Text).ToString(); cl.AgreementID = Convert.ToInt32(lblAgrement.Text); cl.SubjectID = Convert.ToInt32(ddSubject.SelectedValue); DataSet ds = AgreementClass.GetListReport2(cl); DataView dv = new DataView(ds.Tables[0]); if (ViewState["AgreementID"] == null) { ViewState["AgreementID"] = "AgreementID Desc"; } dv.Sort = Securenamespace.SecureData.CheckSecurity(ViewState["AgreementID"].ToString()).ToString(); GridView1.DataSource = dv; GridView1.DataBind(); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; LBLkHESARAT.Text = dr["finekhesarat"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ClAgreement cl = new ClAgreement(); cl.AgreementID = Convert.ToInt32(Request.QueryString["aid"].ToString()); DataSet ds = AgreementClass.GetList(cl); DataRow dr = ds.Tables[0].Rows[0]; lblactive.Text = dr["StatusName"].ToString(); lblFulname.Text = dr["AgreementID"].ToString() + " " + dr["FullName"].ToString(); lblPeymanIDName.Text = dr["PeymanName"].ToString(); lblStatrtDateAgreement.Text = DateConvert.m2sh(dr["StatrtDateAgreement"].ToString()).ToString(); lblsupervisorStaticIDName.Text = dr["SuperVisorName"].ToString(); //LBlPayePrice.Text = dr[""].ToString(); //LBlMablagh.Text = dr[""].ToString(); LBLPeymankarName.Text = dr["PeymanKarIDName"].ToString(); if (dr["StatusID"].ToString() == "1") { lblactive.ForeColor = System.Drawing.Color.Green; } else { lblactive.ForeColor = System.Drawing.Color.Red; } } }
public string UserPeyman(string UserName, string Password) { var hash = FormsAuthentication.HashPasswordForStoringInConfigFile(Password + "~!@", "MD5"); try { DataSet ds = TaxiDAL.UsersClass.GetList(null, UserName, hash, null, null, null, null, null, null, null, null, null); DataRow dr = ds.Tables[0].Rows[0]; ClAgreement cl = new ClAgreement(); if (dr["semat"].ToString() == "1") //user is peymankar { cl.PeymanKarID = Convert.ToInt32(dr["userid"]); } else { cl.supervisor2ID = Convert.ToInt32(dr["userid"]); } DataSet dspeyman = AgreementClass.GetList(cl); return(dspeyman.GetXml()); } catch { return(null); } }
private int GetPeymanAgreement(int agreeid) { ClAgreement cl = new ClAgreement(); cl.AgreementID = agreeid; DataSet ds = AgreementClass.GetList(cl); DataRow dr = ds.Tables[0].Rows[0]; return(Convert.ToInt32(dr["PeymanID"].ToString())); }
public void UpItem(object sender, EventArgs e) { String AgreementID = ((HtmlAnchor)sender).HRef.ToString(); LblParamAgreementID.Text = AgreementID; ClAgreement cl = new ClAgreement(); cl.AgreementID = Convert.ToInt32(AgreementID); Data = cl; LightBox.Value = "1"; VisiblePrice = true; // TXTPricePayeAgreementYear.Text = CalPricePaye(Convert.ToInt32(AgreementID)); }
private void BindDD() { ClAgreement cl = new ClAgreement(); DataSet ds = AgreementClass.GetList(cl); ddagree.DataSource = ds; ddagree.DataTextField = "AggreeName"; ddagree.DataValueField = "AgreementID"; ddagree.DataBind(); ddagree.Items.Insert(0, new ListItem("پیش فرض", "0")); BindPeyman2(); }
public static int insert(ClAgreement c) { SqlCommand cmd = new SqlCommand("PRC_Agreement_Insert", cnn); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("UserIDLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetUserID(); cmd.Parameters.Add(new SqlParameter("IpLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetIPAddress(); cmd.Parameters.Add(new SqlParameter("OSLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetOS(); cmd.Parameters.Add(new SqlParameter("OSVerLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetBrowser() + CSharp.PublicFunction.GetBrowserVersion(); cmd.Parameters.Add(new SqlParameter("URLLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetURL(); cmd.Parameters.Add(new SqlParameter("PeymanID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.PeymanID); cmd.Parameters.Add(new SqlParameter("PeymanKarID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.PeymanKarID); cmd.Parameters.Add(new SqlParameter("supervisorStaticID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.supervisorStaticID); cmd.Parameters.Add(new SqlParameter("MasterGreenSpaceID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.MasterGreenSpaceID); cmd.Parameters.Add(new SqlParameter("supervisor2ID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.supervisor2ID); cmd.Parameters.Add(new SqlParameter("supervisor3ID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.supervisor3ID); cmd.Parameters.Add(new SqlParameter("StatrtDateAgreement", SqlDbType.NVarChar)).Value = Securenamespace.SecureData.CheckSecurity(c.StatrtDateAgreement); cmd.Parameters.Add(new SqlParameter("EndDateAgreement", SqlDbType.NVarChar)).Value = Securenamespace.SecureData.CheckSecurity(c.EndDateAgreement); cmd.Parameters.Add(new SqlParameter("PriceAgreementYear", SqlDbType.BigInt)).Value = c.PriceAgreementYear; cmd.Parameters.Add(new SqlParameter("MonitorinOfficeID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.MonitorinOfficeID); cmd.Parameters.Add(new SqlParameter("Puls", SqlDbType.Decimal)).Value = c.Puls; cmd.Parameters.Add(new SqlParameter("IsTamdid", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.IsTamdid); cmd.Parameters.Add(new SqlParameter("AgreeTamdid", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.AgreeTamdid); cmd.Parameters.Add(new SqlParameter("AgreeSerial", SqlDbType.NVarChar)).Value = Securenamespace.SecureData.CheckSecurity(c.AgreeSerial); cmd.Parameters.Add(new SqlParameter("EtabarAgreement", SqlDbType.BigInt)).Value = c.EtabarAgreement; cmd.Parameters.Add(new SqlParameter("AgreeName", SqlDbType.NVarChar)).Value = c.AgreeName; SqlParameter prmResult = new SqlParameter("Result", SqlDbType.Int); prmResult.Direction = ParameterDirection.Output; cmd.Parameters.Add(prmResult); try { cnn.Open(); cmd.ExecuteNonQuery(); return(Convert.ToInt32(prmResult.Value)); } catch (Exception ex) { return(0); } finally { cnn.Close(); } }
public static DataSet GetListReport2(ClAgreement c) { SqlCommand cmd = new SqlCommand("PRC_Agreement_GetListReport3", cnn); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("UserIDLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetUserID(); cmd.Parameters.Add(new SqlParameter("IpLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetIPAddress(); cmd.Parameters.Add(new SqlParameter("OSLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetOS(); cmd.Parameters.Add(new SqlParameter("OSVerLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetBrowser() + CSharp.PublicFunction.GetBrowserVersion(); cmd.Parameters.Add(new SqlParameter("URLLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetURL(); cmd.Parameters.Add(new SqlParameter("AgreementID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.AgreementID); cmd.Parameters.Add(new SqlParameter("PeymanID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.PeymanID); cmd.Parameters.Add(new SqlParameter("PeymanKarID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.PeymanKarID); cmd.Parameters.Add(new SqlParameter("supervisorStaticID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.supervisorStaticID); cmd.Parameters.Add(new SqlParameter("MasterGreenSpaceID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.MasterGreenSpaceID); cmd.Parameters.Add(new SqlParameter("supervisor2ID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.supervisor2ID); cmd.Parameters.Add(new SqlParameter("supervisor3ID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.supervisor3ID); cmd.Parameters.Add(new SqlParameter("StatrtDateAgreement", SqlDbType.NVarChar)).Value = Securenamespace.SecureData.CheckSecurity(c.StatrtDateAgreement); cmd.Parameters.Add(new SqlParameter("EndDateAgreement", SqlDbType.NVarChar)).Value = Securenamespace.SecureData.CheckSecurity(c.EndDateAgreement); cmd.Parameters.Add(new SqlParameter("PriceAgreementYear", SqlDbType.BigInt)).Value = c.PriceAgreementYear; cmd.Parameters.Add(new SqlParameter("MonitorinOfficeID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.MonitorinOfficeID); cmd.Parameters.Add(new SqlParameter("FromDateReport", SqlDbType.NVarChar)).Value = Securenamespace.SecureData.CheckSecurity(c.FromDateReport); cmd.Parameters.Add(new SqlParameter("ToDateReport", SqlDbType.NVarChar)).Value = Securenamespace.SecureData.CheckSecurity(c.ToDateReport); cmd.Parameters.Add(new SqlParameter("Subjectid", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.SubjectID); SqlParameter prmResult = new SqlParameter("Result", SqlDbType.Int); prmResult.Direction = ParameterDirection.Output; cmd.Parameters.Add(prmResult); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); try { cnn.Open(); da.Fill(ds); return(ds); } catch (Exception ex) { return(null); } finally { cnn.Close(); } }
public void BindGrid() { ClAgreement cl = new ClAgreement(); DataSet ds = AgreementClass.GetList(cl); DataView dv = new DataView(ds.Tables[0]); if (ViewState["AgreementID"] == null) { ViewState["AgreementID"] = "AgreementID Desc"; } dv.Sort = Securenamespace.SecureData.CheckSecurity(ViewState["AgreementID"].ToString()).ToString(); GridView1.DataSource = dv; GridView1.DataBind(); }
private string CalPricePaye(int agreeid) { ClAgreement cl = new ClAgreement(); cl.AgreementID = agreeid; DataSet ds = AgreementClass.GetListCalPrice(cl); DataRow dr = ds.Tables[0].Rows[0]; if (ds.Tables[0].Rows.Count > 0) { return(Convert.ToDouble(dr["calPriceAgree"].ToString() == "" ?"0":dr["calPriceAgree"].ToString()).ToString()); } return("0"); }
private void BindGrid() { ClAgreement cl = new ClAgreement(); cl.UserID = Convert.ToInt32(CSharp.PublicFunction.GetUserID()); DataSet ds = AgreementClass.GetListUserPeyman(cl); DataView dv = new DataView(ds.Tables[0]); if (ViewState["AgreementID "] == null) { ViewState["AgreementID"] = "AgreementID Desc"; } dv.Sort = ViewState["AgreementID"].ToString(); GridView1.DataSource = dv; GridView1.DataBind(); }
public void BindDD() { DDExplanID.Bind(); //DDExplanID.Attributes.Add(); ClAgreement cl = new ClAgreement(); DDAgreementID.DataSource = AgreementClass.GetList(cl); DDAgreementID.DataTextField = "AgreeName"; DDAgreementID.DataValueField = "AgreementID"; DDAgreementID.DataBind(); if (NotDefaultAgree) { DDAgreementID.Items.Insert(0, new ListItem("پیش فرض", "0")); } BindSubject(); }
protected void ddAgreeTamdid_SelectedIndexChanged(object sender, EventArgs e) { if (Convert.ToInt32(ddAgreeTamdid.SelectedValue) > 0) { ClAgreement cl = new ClAgreement(); cl.AgreementID = Convert.ToInt32(ddAgreeTamdid.SelectedValue); DataSet ds = AgreementClass.GetList(cl); DataRow dr = ds.Tables[0].Rows[0]; DDPeymanID.SelectedValue = dr["PeymanID"].ToString(); DDPeymanKarID.SelectedValue = dr["PeymanKarID"].ToString(); DDsupervisor2ID.SelectedValue = dr["supervisor2ID"].ToString(); DDsupervisor3ID.SelectedValue = dr["supervisor3ID"].ToString(); DDMasterGreenSpaceID.SelectedValue = dr["MasterGreenSpaceID"].ToString(); DDsupervisorStaticID.SelectedValue = dr["supervisorStaticID"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { dAgree.Visible = false; if (Request.QueryString["RName"] == null) { return; } if (Request.QueryString["RName"].ToString() == "Rp_SubjectPrice" || Request.QueryString["RName"].ToString() == "Rp_Percent" || Request.QueryString["RName"].ToString() == "Rp_Area" || Request.QueryString["RName"].ToString() == "Rp_Price2" || Request.QueryString["RName"].ToString() == "Rp_Khesarat" || Request.QueryString["RName"].ToString() == "rp_khesart3" || Request.QueryString["RName"].ToString() == "Rp_Park" || Request.QueryString["RName"].ToString() == "Rp_ExplainPrice2" ) { ClAgreement cl = new ClAgreement(); ddAgree.DataSource = AgreementClass.GetList(cl); ddAgree.DataTextField = "AggreeName"; ddAgree.DataValueField = "AgreementID"; ddAgree.DataBind(); ddAgree.Items.Insert(0, new ListItem("پیش فرض", "0")); dAgree.Visible = true; } ctlArchiveDD.BindDD(); if (Request.QueryString["RName"].ToString() == "SumPay" || Request.QueryString["RName"].ToString() == "SumPay2" || Request.QueryString["RName"].ToString() == "RptSumPayPage" ) { dsubject.Visible = true; CtlAllSubjectExplan.BindAll = "1"; CtlAllSubjectExplan.BindDD(); } } }
private void checkTamdid() { bool ch = chIsTamdid.Checked; DDPeymanID.Enabled = !ch; DDPeymanKarID.Enabled = !ch; trtamdidAgree.Visible = ch; if (ddAgreeTamdid.Items.Count == 0) { ClAgreement cl = new ClAgreement(); ddAgreeTamdid.DataSource = AgreementClass.GetList(cl); ddAgreeTamdid.DataTextField = "AggreeName"; ddAgreeTamdid.DataValueField = "AgreementID"; ddAgreeTamdid.DataBind(); ddAgreeTamdid.Items.Insert(0, new ListItem("انتخاب نمایید", "0")); } }
public void BindDD() { ddSubjectFilter.DataSource = TaxiDAL.CatalogClass.GetListTypeID("3"); ddSubjectFilter.DataTextField = "CatalogName"; ddSubjectFilter.DataValueField = "CatalogValue"; ddSubjectFilter.DataBind(); ClAgreement cl = new ClAgreement(); DDAgreementID.DataSource = AgreementClass.GetList(cl); DDAgreementID.DataTextField = "AgreeName"; DDAgreementID.DataValueField = "AgreementID"; DDAgreementID.DataBind(); if (NotDefaultAgree) { DDAgreementID.Items.Insert(0, new ListItem("پیش فرض", "0")); } DDExplanID.Bind(); YearMonthShow(); }
public void BindDD() { DateTime sd = DateTime.Now; DateTime ed; try { ClAgreement cl = new ClAgreement(); DDAgreementID.DataSource = AgreementClass.GetList(cl); DDAgreementID.DataTextField = "AgreeName"; DDAgreementID.DataValueField = "AgreementID"; DDAgreementID.DataBind(); DDSuperVisorID.DataSource = TaxiDAL.UsersClass.GetListNazer(null, null, null, null, null, null, "600", null, null, null, null); DDSuperVisorID.DataTextField = "FullNameUser"; DDSuperVisorID.DataValueField = "UserID"; DDSuperVisorID.DataBind(); DDExplainID.Bind(); CtlAgreePercentProtest1.BindDD(); Bindtbljarime(); DDExplainID.AutoPostBackExplan = true; } catch (Exception ex) { ed = DateTime.Now; var lineNumber = new System.Diagnostics.StackTrace(ex, true).GetFrame(0).GetFileLineNumber(); clError cl = new clError(); cl.ErrorLog = ex.Message.ToString(); cl.Page = HttpContext.Current.Request.Url.OriginalString; cl.timeLeft = (ed - sd).TotalSeconds.ToString(); cl.IP = CSharp.PublicFunction.GetIPAddress(); ErrorDAL.insert(cl); } }
//--------------------------------------------------------------------------------------------------------- public static DataSet GetListUserPeyman(ClAgreement c) { SqlCommand cmd = new SqlCommand("PRC_AllPeymanPerson", cnn); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("UserIDLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetUserID(); cmd.Parameters.Add(new SqlParameter("IpLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetIPAddress(); cmd.Parameters.Add(new SqlParameter("OSLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetOS(); cmd.Parameters.Add(new SqlParameter("OSVerLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetBrowser() + CSharp.PublicFunction.GetBrowserVersion(); cmd.Parameters.Add(new SqlParameter("URLLog", SqlDbType.NVarChar)).Value = CSharp.PublicFunction.GetURL(); cmd.Parameters.Add(new SqlParameter("UserID", SqlDbType.Int)).Value = Securenamespace.SecureData.CheckSecurity(c.UserID); SqlParameter prmResult = new SqlParameter("Result", SqlDbType.Int); prmResult.Direction = ParameterDirection.Output; cmd.Parameters.Add(prmResult); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); try { cnn.Open(); da.Fill(ds); return(ds); } catch (Exception ex) { return(null); } finally { cnn.Close(); } }