예제 #1
0
        public void load_manualDetails()
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "dbCML";
            _clsmanufacture _objcls = new _clsmanufacture();

            _objcls.project_code = (string)Session["project"];
            DataTable _Doctype = _objbll.load_doctype(_objdb);
            DataTable _dtable1 = new DataTable();

            _dtable1.Columns.Add("id");
            _dtable1.Columns.Add("type");
            var _List = from o in _Doctype.AsEnumerable()
                        where o.Field <int>(5) == Convert.ToInt32(drpackage.SelectedItem.Value)
                        select o;

            //ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('" + (string)Session["project"] + "');", true);
            foreach (var row in _List)
            {
                if (row[7].ToString() == "1")
                {
                    Session["om"] = row[0].ToString();
                }
            }
            //ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('" + (string)Session["docid"] + "');", true);
            _clsdocument _objcls1 = new _clsdocument();

            _objcls1.folder_id = Convert.ToInt32((string)Session["om"]);
            //int _docid = _objbll.Get_ManualID(_objcls1);
            Session["docid"] = _objbll.Get_ManualID(_objcls1, _objdb).ToString();
            load_comments();
        }
예제 #2
0
        void load_services()
        {
            BLL_Dml         _objbll = new BLL_Dml();
            _clsmanufacture _objcls = new _clsmanufacture();

            _objcls.project_code = (string)Session["project"];
            //chkservice.DataSource = _objbll.load_service(_objcls);
            //chkservice.DataTextField = "Folder_description";
            //chkservice.DataValueField = "Folder_id";
            //chkservice.DataBind();
        }
        protected void cmdadd_Click(object sender, EventArgs e)
        {
            if (txtnewmanufacturer.Text == "")
            {
                return;
            }
            BLL_Dml   _objbal = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "dbCML";
            _clsmanufacture _objcls = new _clsmanufacture();

            _objcls.project_code = (string)Session["project"];
            _objcls.man_name     = txtnewmanufacturer.Text;
            string _type = (string)Session["type"];

            //ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('"+ _type +"');", true);
            if (_type == "2")
            {
                _objbal.Create_Manufacture(_objcls, _objdb);
                load_manufacturer();
                ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('Created New Manufacturer!');", true);
            }
            else if (_type == "1")
            {
                _objbal.Create_Contractor(_objcls, _objdb);
                load_contractor();
                ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('Created New Contractor!');", true);
            }
            else
            {
                _objbal.Create_Manufacture(_objcls, _objdb);
                load_manufacturer();
                ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('Created New Manufacturer!');", true);
            }
            Panel1.Visible          = false;
            txtnewmanufacturer.Text = "";
            cmdnew.Enabled          = true;
        }