protected void btnDelete_Click(object sender, EventArgs e)
        {
            ICurrencyService service = ServiceFactory.GetService <ICurrencyService>();

            foreach (GridViewRow objGVR in this.gvList.Rows)
            {
                if (objGVR.RowType == DataControlRowType.DataRow)
                {
                    CheckBox cbSelect = objGVR.FindControl("cbSelect") as CheckBox;

                    if (cbSelect != null && cbSelect.Checked)
                    {
                        int pkId = this.gvList.DataKeys[objGVR.RowIndex]["PkId"].ToString().ToInt();

                        var objCurrencyExport = service.GetObject_Export(pkId);

                        if (objCurrencyExport != null)
                        {
                            FileHelper.DeleteFile("~/App_File/Export/" + objCurrencyExport.FileName);

                            service.Delete_Export(objCurrencyExport.PkId);
                        }
                    }
                }
            }

            BasicConvert.ClearCache();

            this.JscriptMsg("数据删除成功", null, "Success");
        }
Пример #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (this.IsValid)
            {
                IBasicService service = ServiceFactory.GetService <IBasicService>();

                BasicOrganization entity = null;

                if (this.IsInsert)
                {
                    entity = new BasicOrganization()
                    {
                        OrgNumber   = this.txtOrgNumber.Text.Trim(),
                        OrgName     = this.txtOrgName.Text.Trim(),
                        OrgAddress  = this.txtOrgAddress.Text.Trim(),
                        OrgParentId = this.hfOrgParentId.Value.Trim().ToInt(0),
                        OrgFullPath = ""
                    };

                    if (service.CheckExists_Organization(entity))
                    {
                        this.JscriptMsg("网点机构号码已存在", null, "Error");

                        return;
                    }
                }

                else
                {
                    entity = service.GetObject_Organization(this.PkId);

                    if (entity != null)
                    {
                        entity.OrgName     = this.txtOrgName.Text.Trim();
                        entity.OrgAddress  = this.txtOrgAddress.Text.Trim();
                        entity.OrgParentId = this.hfOrgParentId.Value.Trim().ToInt(0);
                    }
                }

                service.Save_Organization(entity);

                if (this.IsInsert)
                {
                    entity.OrgFullPath = entity.OrgParentId.ToString().GetOrgFullPath() + "[" + entity.PkId + "]";

                    service.Save_Organization(entity);
                }

                if (this.IsInsert && (sender as Button).CommandName == "SubmitContinue")
                {
                    this.ReturnUrl = this.Request.Url.PathAndQuery;
                }

                this.JscriptMsg("数据保存成功", this.ReturnUrl, "Success");
            }

            BasicConvert.ClearCache();
        }
Пример #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (this.IsValid)
            {
                IBasicService service = ServiceFactory.GetService <IBasicService>();

                BasicDictionary entity = null;

                if (this.IsInsert)
                {
                    entity = new BasicDictionary()
                    {
                        DictKind  = this.Kind.ToByte(0),
                        DictKey   = this.txtDictKey.Text.Trim().ToByte(0),
                        DictValue = this.txtDictValue.Text.Trim(),
                        IsSystem  = 0
                    };

                    if (service.CheckExists_Dictionary(entity))
                    {
                        this.JscriptMsg("字典数据键已存在", null, "Error");

                        return;
                    }
                }

                else
                {
                    entity = service.GetObject_Dictionary(this.PkId);

                    if (entity != null)
                    {
                        entity.DictValue = this.txtDictValue.Text.Trim();
                    }
                }

                service.Save_Dictionary(entity);

                if (this.IsInsert && (sender as Button).CommandName == "SubmitContinue")
                {
                    this.ReturnUrl = this.Request.Url.AbsolutePath;
                }

                this.JscriptMsg("数据保存成功", this.ReturnUrl, "Success");
            }

            BasicConvert.ClearCache();
        }
Пример #4
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            IBasicService service = ServiceFactory.GetService <IBasicService>();

            foreach (GridViewRow objGVR in this.gvList.Rows)
            {
                if (objGVR.RowType == DataControlRowType.DataRow)
                {
                    CheckBox cbSelect = objGVR.FindControl("cbSelect") as CheckBox;

                    if (cbSelect != null && cbSelect.Checked)
                    {
                        int dictId = this.gvList.DataKeys[objGVR.RowIndex]["PkId"].ToString().ToInt();

                        service.Delete_Dictionary(dictId);
                    }
                }
            }

            this.JscriptMsg("数据删除成功", null, "Success");

            BasicConvert.ClearCache();
        }