protected void btnAuthorization_Click(object sender, EventArgs e)
    {
        eFileAuthorization eFileAuthorization = new eFileAuthorization();

        if (this.HdnYhdmList.Value != "")
        {
            if (this.RBSelect.SelectedValue == "0")
            {
                for (int i = 0; i < this.GVProjectFile.Rows.Count; i++)
                {
                    CheckBox checkBox = (CheckBox)this.GVProjectFile.Rows[i].FindControl("CBRecordID");
                    if (checkBox.Checked)
                    {
                        eFileAuthorization.FileRecordID = Convert.ToInt32(this.GVProjectFile.DataKeys[i]["RecordID"].ToString());
                        eFileAuthorization.LeaderCode   = this.Session["yhdm"].ToString();
                        eFileAuthorization.ReaderCodes  = this.HdnYhdmList.Value.ToString();
                        this.efaa.Add(eFileAuthorization);
                    }
                }
                return;
            }
            for (int j = 0; j < this.GVeFile.Rows.Count; j++)
            {
                CheckBox checkBox2 = (CheckBox)this.GVeFile.Rows[j].FindControl("CBRecordID");
                if (checkBox2.Checked)
                {
                    eFileAuthorization.FileRecordID = Convert.ToInt32(this.GVeFile.DataKeys[j]["RecordID"].ToString());
                    eFileAuthorization.LeaderCode   = this.Session["yhdm"].ToString();
                    eFileAuthorization.ReaderCodes  = this.HdnYhdmList.Value.ToString();
                    this.efaa.Add(eFileAuthorization);
                }
            }
        }
    }
Exemple #2
0
        public int Update(eFileAuthorization model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update OA_eFile_Authorization set ");
            builder.Append("ReaderCodes='" + model.ReaderCodes + "'");
            builder.Append(" where LeaderCode='" + model.LeaderCode + "'");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
Exemple #3
0
        public int Add(eFileAuthorization model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into OA_eFile_Authorization(");
            builder.Append("LeaderCode,FileRecordID,ReaderCodes");
            builder.Append(")");
            builder.Append(" values (");
            builder.Append("'" + model.LeaderCode + "',");
            builder.Append(model.FileRecordID + ",");
            builder.Append("'" + model.ReaderCodes + "'");
            builder.Append(")");
            return(publicDbOpClass.ExecSqlString(builder.ToString()));
        }
Exemple #4
0
        public eFileAuthorization GetModel(string LeaderCode)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select *  ");
            builder.Append(" LeaderCode,FileRecordID,ReaderCodes ");
            builder.Append(" from OA_eFile_Authorization ");
            builder.Append(" where LeaderCode='" + LeaderCode + "'");
            eFileAuthorization authorization = new eFileAuthorization();
            DataSet            set           = publicDbOpClass.DataSetQuary(builder.ToString());

            if (set.Tables[0].Rows.Count <= 0)
            {
                return(null);
            }
            authorization.LeaderCode = set.Tables[0].Rows[0]["LeaderCode"].ToString();
            if (set.Tables[0].Rows[0]["FileRecordID"].ToString() != "")
            {
                authorization.FileRecordID = int.Parse(set.Tables[0].Rows[0]["FileRecordID"].ToString());
            }
            authorization.ReaderCodes = set.Tables[0].Rows[0]["ReaderCodes"].ToString();
            return(authorization);
        }