Ejemplo n.º 1
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (this.IsPass())
        {
            this.amAction.UpdateAudit(this.InStorageID, "0");
        }
        else
        {
            this.amAction.UpdateAudit(this.InStorageID, "1");
        }
        OAOfficeResDepartmentApplicationDetail data = this.GetData();

        if (this.OperateType == "add")
        {
            int num = this.amAction.Add(data);
            if (num > 0)
            {
                this.Page.RegisterStartupScript("", "<script>alert('添加成功!');returnValue=true;window.close();</script>");
            }
            else
            {
                this.Page.RegisterStartupScript("", "<script>alert('没有相关数据可添加!');</script>");
            }
        }
        if (this.OperateType == "upd")
        {
            int num = this.amAction.Update(data);
            if (num > 0)
            {
                this.Page.RegisterStartupScript("", "<script>alert('修改成功!');returnValue=true;window.close();</script>");
                return;
            }
            this.Page.RegisterStartupScript("", "<script>alert('没有相关数据可更新!');</script>");
        }
    }
Ejemplo n.º 2
0
        public OAOfficeResDepartmentApplicationDetail GetModel(int DADRecordID)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select *  ");
            builder.Append(" DADRecordID,DARecordID,MaterialID,ApplyNumber,IsPass ");
            builder.Append(" from OA_OfficeRes_DepartmentApplicationDetail ");
            builder.Append(" where DADRecordID=" + DADRecordID);
            OAOfficeResDepartmentApplicationDetail detail = new OAOfficeResDepartmentApplicationDetail();
            DataSet set = publicDbOpClass.DataSetQuary(builder.ToString());

            if (set.Tables[0].Rows.Count <= 0)
            {
                return(null);
            }
            if (set.Tables[0].Rows[0]["DADRecordID"].ToString() != "")
            {
                detail.DADRecordID = int.Parse(set.Tables[0].Rows[0]["DADRecordID"].ToString());
            }
            if (set.Tables[0].Rows[0]["DARecordID"].ToString() != "")
            {
                detail.DARecordID = new Guid(set.Tables[0].Rows[0]["DARecordID"].ToString());
            }
            if (set.Tables[0].Rows[0]["MaterialID"].ToString() != "")
            {
                detail.MaterialID = int.Parse(set.Tables[0].Rows[0]["MaterialID"].ToString());
            }
            if (set.Tables[0].Rows[0]["ApplyNumber"].ToString() != "")
            {
                detail.ApplyNumber = int.Parse(set.Tables[0].Rows[0]["ApplyNumber"].ToString());
            }
            detail.IsPass = set.Tables[0].Rows[0]["IsPass"].ToString();
            return(detail);
        }
Ejemplo n.º 3
0
        public int Update(OAOfficeResDepartmentApplicationDetail model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update OA_OfficeRes_DepartmentApplicationDetail set ");
            builder.Append("MaterialID=" + model.MaterialID + ",");
            builder.Append("ApplyNumber=" + model.ApplyNumber);
            builder.Append(" where DADRecordID=" + model.DADRecordID);
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
Ejemplo n.º 4
0
        public int Add(OAOfficeResDepartmentApplicationDetail model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into OA_OfficeRes_DepartmentApplicationDetail(");
            builder.Append("DARecordID,MaterialID,ApplyNumber,IsPass");
            builder.Append(")");
            builder.Append(" values (");
            builder.Append("'" + model.DARecordID + "',");
            builder.Append(model.MaterialID + ",");
            builder.Append(model.ApplyNumber + ",");
            builder.Append("'" + model.IsPass + "'");
            builder.Append(")");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }