protected void BtnInsert_Click(Object sender, System.EventArgs e) { string PeymanId = null; if (DDPeymanid.SelectedValue.ToString() != "") { PeymanId = DDPeymanid.SelectedValue.ToString(); } string LicesnceTypeid = null; if (DDLicesnceTypeid.SelectedValue.ToString() != "") { LicesnceTypeid = DDLicesnceTypeid.SelectedValue.ToString(); } int t = CuttingTreeClass.insert(null, null, null, TXTdate.Text, TXTAddress.Text, null, null, null, null, chkPeyman.Checked.ToString(), PeymanId, DDMantagheId.SelectedValue.ToString(), chkMojavez.Checked, Haghighiid.ToString(), LicesnceTypeid, TXTTitle.Text, TXTDesc.Text, null, null); if (t == 0) { LblMsg.ForeColor = System.Drawing.Color.Red; LblMsg.Text = "خطا در ثبت"; } else { LblMsg.ForeColor = System.Drawing.Color.Green; LblMsg.Text = "ثبت انجام شد."; BindGrid(); } }
protected void btnInsert_Click(object sender, EventArgs e) { if (Session["PersonalID"] != null) { string pid = Session["PersonalID"].ToString(); string hid = ""; if (Session["HaghighiID"] != null) { hid = Session["HaghighiID"].ToString(); } string date = CtlDatePick.Text; //int e =Int16.Parse(CtlDatePick.Text.Length - 1); //date = CtlDatePick.Text.Remove(10, CtlDatePick.Text.Length - 1); int t = CuttingTreeClass.insert(ddlTreeType.SelectedValue, txtCount.Text, txtBon.Text, date, txtAddress.Text, "", "", ddlStreetType.SelectedValue, pid, null, "", ddRegion.SelectedValue, chkMojavez.Checked, hid, ddlLicesnceType.SelectedValue, "", "", "4", "9063"); if (t == 0) { LblMsg.ForeColor = System.Drawing.Color.Red; LblMsg.Text = "خطا در ثبت"; } else { LblMsg.ForeColor = System.Drawing.Color.Green; LblMsg.Text = "ثبت انجام شد."; kartable.Insert(null, "4", DateTime.Now, "", null, pid, null, "9063", t.ToString()); Response.Redirect("RequestList.aspx"); } } }