Ejemplo n.º 1
0
        private void LoadData()
        {
            string supplierOpinionCode = Request.QueryString["SupplierOpinionCode"] + "";
            string supplierCode        = Request["SupplierCode"] + "";

            this.SupplierName.Text = BLL.ProjectRule.GetSupplierName(supplierCode);

            if (supplierOpinionCode == "")
            {
                this.btnDelete.Visible = false;
                return;
            }

            try
            {
                EntityData entity = ProjectDAO.GetSupplierOpinionByCode(supplierOpinionCode);
                if (entity.HasRecord())
                {
                    OpinionPerson.Text  = entity.GetString("OpinionPerson");
                    Event.Text          = entity.GetString("Event");
                    Opinion.Text        = entity.GetString("Opinion");
                    dtOpinionDate.Value = entity.GetDateTimeOnlyDate("OpinionDate");
                }
                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }
Ejemplo n.º 2
0
        protected void btnSave_ServerClick(object sender, System.EventArgs e)
        {
            string supplierOpinionCode = Request.QueryString["SupplierOpinionCode"] + "";
            string supplierCode        = Request["SupplierCode"] + "";

            bool isNew = (supplierOpinionCode == "");

            try
            {
                EntityData entity = null;
                DataRow    dr     = null;

                if (isNew)
                {
                    entity = new EntityData("SupplierOpinion");
                    supplierOpinionCode = DAL.EntityDAO.SystemManageDAO.GetNewSysCode("supplierOpinionCode");
                    dr = entity.GetNewRecord();
                    dr["supplierOpinionCode"] = supplierOpinionCode;
                    dr["supplierCode"]        = supplierCode;
                }
                else
                {
                    entity = ProjectDAO.GetSupplierOpinionByCode(supplierOpinionCode);
                    dr     = entity.CurrentRow;
                }
                dr["OpinionPerson"] = OpinionPerson.Text;
                dr["Event"]         = Event.Text;
                dr["Opinion"]       = Opinion.Text;
                if (dtOpinionDate.Value != "")
                {
                    dr["OpinionDate"] = this.dtOpinionDate.Value;
                }
                else
                {
                    dr["OpinionDate"] = System.DBNull.Value;
                }

                if (isNew)
                {
                    entity.AddNewRecord(dr);
                    DAL.EntityDAO.ProjectDAO.InsertSupplierOpinion(entity);
                }
                else
                {
                    DAL.EntityDAO.ProjectDAO.UpdateSupplierOpinion(entity);
                }

                entity.Dispose();

                CloseWindow();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }
Ejemplo n.º 3
0
        //protected void dgDocumentList_ItemDataBound1(object sender, DataGridItemEventArgs e)
        //{
        //    if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
        //    {

        //        System.Web.UI.HtmlControls.HtmlGenericControl divMainHtml = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("divMainText");
        //        divMainHtml.InnerHtml = HttpUtility.HtmlDecode(divMainHtml.InnerText);
        //    }
        //}
        protected void DataGrid_supplierRecord_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            EntityData entity = null;

            try
            {
                entity = new EntityData("SupplierOpinion");

                string supplierOpinionCode = DataGrid_supplierRecord.DataKeys[e.Item.ItemIndex].ToString();
                entity = ProjectDAO.GetSupplierOpinionByCode(supplierOpinionCode);
                DAL.EntityDAO.ProjectDAO.DeleteSupplierOpinion(entity);
                FreshData();
            }

            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }
Ejemplo n.º 4
0
        protected void btnDelete_ServerClick(object sender, System.EventArgs e)
        {
            string supplierOpinionCode = Request.QueryString["SupplierOpinionCode"] + "";

            if (supplierOpinionCode == "")
            {
                return;
            }

            try
            {
                EntityData entity = ProjectDAO.GetSupplierOpinionByCode(supplierOpinionCode);
                DAL.EntityDAO.ProjectDAO.DeleteSupplierOpinion(entity);
                entity.Dispose();
                CloseWindow();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
            }
        }