protected void btnSave_Click(object sender, EventArgs e) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString()); DataRow dr = dt.NewRow(); dr["WarehouseID"] = this.txtWarehouseID.Text.Trim().ToUpper(); dr["WarehouseName"] = this.txtWarehouseName.Text; dr["Contact"] = this.txtContact.Text.Trim(); dr["ContactPhone"] = this.txtContactPhone.Text.Trim(); dr["Address"] = this.txtAddress.Text.Trim(); dr["Memo"] = this.txtMemo.Text.Trim(); dr["CreateUserName"] = this.txtCreateUserName.Text; dr["CreateDate"] = this.txtCreateDate.Text; dr["LastModifyUserName"] = Session["User"].ToString(); dr["LastModifyDate"] = DateTime.Now.ToString(Js.Com.User.strDateFormat); dr["CheckUserName"] = this.txtCheckUserName.Text; if (this.txtCheckDate.Text.Length > 0) dr["CheckDate"] = this.txtCheckDate.Text; dr["StopUserName"] = this.txtStopUserName.Text; if (this.txtStopDate.Text.Length > 0) dr["StopDate"] = this.txtStopDate.Text; if (ID.Length > 0) dal.Update(dr, ID); else { dal.Add(dr); //插入標籤數量 Js.BLL.Label.StyleDal sdal = new Js.BLL.Label.StyleDal(cnKey); sdal.InsertWarehousePagesByWID(this.txtWarehouseID.Text.Trim().ToUpper(), Session["User"].ToString()); } //Response.Redirect("Departments.aspx?FormID=" + Server.UrlEncode(FormID)); Response.Redirect("WarehouseView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtWarehouseID.Text)); }
protected void btnDeletet_Click(object sender, EventArgs e) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); Js.BLL.Sys.SysComDal sdal = new Js.BLL.Sys.SysComDal(cnKey); int iReturn = 0; for (int i = 0; i < this.GridView1.Rows.Count; i++) { CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect")); if (cb.Checked) { HyperLink hk = (HyperLink)(this.GridView1.Rows[i].FindControl("HyperLink1")); iReturn = sdal.GetBillCanBeEdit(FormID, hk.Text); if (iReturn == 1) JScript.Instance.ShowMessage(this.updatePanel, hk.Text + Resources.Resource.NotDelete_Checked); else if (iReturn == 2) JScript.Instance.ShowMessage(this.updatePanel, hk.Text + Resources.Resource.NotDelete_IsUsed); else { dal.Delete(hk.Text); Js.BLL.Label.StyleDal ddal = new Js.BLL.Label.StyleDal(cnKey); ddal.DeleteWarehousePagesByWID(hk.Text); } } } SetBtnEnabled(""); }
protected void btnSave_Click(object sender, EventArgs e) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID,cnKey); DataTable dt = dal.GetRecord(ViewState["StrWhere"].ToString()); DataRow dr = dt.NewRow(); // dr["ID"] = this.txtEnterpriseID.Text.Trim().ToUpper() + "_" + this.txtStyleID.Text.Trim().ToUpper(); // dr["EnterpriseID"] = this.txtEnterpriseID.Text.ToUpper(); dr["StyleName"] = this.txtStyleName.Text; dr["StyleID"] = this.txtStyleID.Text.Trim().ToUpper(); dr["Volumes"] = this.txtVolumes.DataValue; dr["StdPages"] = this.txtStdPages.DataValue; dr["ImageLocation"] = this.ddlImageLocation.Text.Trim(); dr["Length"] = this.txtLength_R.DataValue; dr["Width"] = this.txtWidth_R.DataValue; dr["Height"] = this.txtHeight_R.DataValue; dr["QRContent"] = this.ddlQRContent.Text.Trim(); dr["ProductionNo"] = this.txtProductionNo.Text.Trim(); dr["QR_X"] = this.txtQR_X_R.DataValue; dr["QR_Y"] = this.txtQR_Y_R.DataValue; dr["QR_Length"] = this.txtQR_Length_R.DataValue; dr["QR_Width"] = this.txtQR_Width_R.DataValue; dr["NowVolumes"] = this.txtNowVolumes.DataValue; dr["NowPages"] = this.txtNowPages.DataValue; dr["ImagePath"] = this.txtImagePath.Text.Trim(); dr["ServiceYears"] = byte.Parse(this.txtServiceYears.Text.Trim()); dr["EnableMonths"] = byte.Parse(this.ddlEnableMonths.SelectedValue.ToString()); dr["Description"] = this.txtDescription.Text.Trim(); dr["AntiFakeDesc1"] = this.txtAntiFakeDesc1.Text.Trim(); dr["ImagePath1"] = this.txtImagePath1.Text.Trim(); dr["AntiFakeDesc2"] = this.txtAntiFakeDesc2.Text.Trim(); dr["ImagePath2"] = this.txtImagePath2.Text.Trim(); dr["AntiFakeDesc3"] = this.txtAntiFakeDesc3.Text.Trim(); dr["ImagePath3"] = this.txtImagePath3.Text.Trim(); dr["CreateUserName"] = this.txtCreateUserName.Text; dr["CreateDate"] = this.txtCreateDate.Text; dr["LastModifyUserName"] = Session["User"].ToString(); dr["LastModifyDate"] = DateTime.Now;//.ToString(Js.Com.User.strDateFormat); dr["CheckUserName"] = this.txtCheckUserName.Text; if (this.txtCheckDate.Text.Length > 0) dr["CheckDate"] = this.txtCheckDate.Text; dr["StopUserName"] = this.txtStopUserName.Text; if (this.txtStopDate.Text.Length > 0) dr["StopDate"] = this.txtStopDate.Text; if (ID.Length > 0) dal.Update(dr, ID); else { dal.Add(dr); //插入標籤數量 Js.BLL.Label.StyleDal sdal = new Js.BLL.Label.StyleDal(cnKey); sdal.InsertWarehousePagesByStyleID(this.txtStyleID.Text.Trim().ToUpper(), Session["User"].ToString()); } Response.Redirect("StyleView.aspx?FormID=" + Server.UrlEncode(FormID) + "&ID=" + Server.UrlEncode(this.txtStyleID.Text)); }
protected void btnDelete_Click(object sender, EventArgs e) { Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID, cnKey); //Js.BLL.BaseDal dal = new Js.BLL.BaseDal(FormID); string strID = this.txtStyleID.Text; dal.Delete(strID); Js.BLL.Label.StyleDal sdal = new Js.BLL.Label.StyleDal(cnKey); sdal.DeleteWarehousePagesByStyleID(strID); btnNext_Click(sender, e); if (this.txtStyleID.Text == strID) btnPre_Click(sender, e); }
protected void Page_Load(object sender, EventArgs e) { ID = Request.QueryString["ID"] + ""; FormID = Request.QueryString["FormID"] + ""; Js.BLL.Label.StyleDal dal = new Js.BLL.Label.StyleDal(cnKey); DataTable dt = dal.GetWarehousePages(ID); HdnSubDetail1.Value = Js.Com.JsonHelper.Dtb2Json(dt); //ID="sub1xxRowID" Text="(序號), 40, label,1" InitSubCols(FormID, cnKey, subColsName1.ID, "LB_WarehousePages"); //InitSubCols(subColsName2.ID, "LB_OrderSub1"); writeJsvar(FormID, cnKey, ID); }
/// <summary> /// 綁定查詢 /// </summary> private void BindDropDownList() { Js.BLL.Label.StyleDal sdal = new Js.BLL.Label.StyleDal(cnKey); DataTable dt = sdal.GetRecord("Flag=2"); this.ddlImageLocation.DataSource = dt; this.ddlImageLocation.DataTextField = "DataText"; this.ddlImageLocation.DataValueField = "DataValue"; this.ddlImageLocation.DataBind(); dt = sdal.GetRecord("Flag=3"); this.ddlQRContent.DataSource = dt; this.ddlQRContent.DataTextField = "DataText"; this.ddlQRContent.DataValueField = "DataValue"; this.ddlQRContent.DataBind(); }