예제 #1
0
        private void Insert_ReportData()
        {
            //int folderId;
            //folderId = Convert.ToInt16(ddlFolderlist.SelectedValue);


            BLL_Dml      _objbll = new BLL_Dml();
            _database    _objdb  = new _database();
            _clsdocument _objcls = new _clsdocument();

            _objdb.DBName = "DBCML";
            _clsproject _objcls1 = new _clsproject();

            _objcls1.prjcode = lblprj.Text;
            _objbll.Update_RPTLogo(_objcls1, _objdb);
            _objbll.Clear_DBMSSummary(_objdb);

            DataTable _dtable = _objbll.Load_DBMSStatus(_objdb);
            var       _status = from _data in _dtable.AsEnumerable()
                                select _data;

            foreach (var row in _status)
            {
                _objcls.folder_id    = Convert.ToInt16(Session["folderId"]);
                _objcls.project_code = lblprj.Text;
                _objcls.status       = row[0].ToString();
                _objbll.Generate_DBMS_Summary_ALL(_objcls, _objdb);
            }
            _objcls.folder_id    = Convert.ToInt16(Session["folderId"]);
            _objcls.status       = "1";
            _objcls.project_code = lblprj.Text;
            _objbll.Generate_DBMS_Summary_ALL(_objcls, _objdb);
            // parm = "ms_" + GetDocNo_All();
        }
예제 #2
0
        private void Generate_Reports()
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clsproject _objcls1 = new _clsproject();

            _objcls1.prjcode = "CCAD";
            _objbll.Update_RPTLogo(_objcls1, _objdb);

            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo  crtableLogoninfo  = new TableLogOnInfo();
            ConnectionInfo  crConnectionInfo  = new ConnectionInfo();
            Tables          CrTables;

            cryRpt.Load(Server.MapPath("sys_list.rpt"));
            crConnectionInfo.ServerName   = "37.61.235.103";
            crConnectionInfo.DatabaseName = "DBCML";
            crConnectionInfo.UserID       = "sa";
            crConnectionInfo.Password     = "******";
            CrTables = cryRpt.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }
            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.DataBind();
            Session["Report"] = cryRpt;
        }
예제 #3
0
        void Ms_summaryAll()
        {
            Session["srv"] = "ALL";

            BLL_Dml      _objbll = new BLL_Dml();
            _database    _objdb  = new _database();
            _clsdocument _objcls = new _clsdocument();

            _objdb.DBName = "DBCML";
            _clsproject _objcls1 = new _clsproject();

            _objcls1.prjcode = lblprj.Text;
            _objbll.Update_RPTLogo(_objcls1, _objdb);
            _objbll.Clear_MSSummary(_objdb);
            _objdb.DBName = "DB_" + lblprj.Text;
            DataTable _dtable = _objbll.Load_MSStatus(_objdb);
            var       _status = from _data in _dtable.AsEnumerable()
                                select _data;

            foreach (var row in _status)
            {
                _objcls.status = row[0].ToString();
                //_objcls.schid = Convert.ToInt32(rd_Building.SelectedItem.Value);
                _objcls.schid = Convert.ToInt32(Request.QueryString["Div"].ToString());
                _objbll.Generate_MS_Summary_ALL_Div(_objcls, _objdb);
            }

            _objcls.status = "1";
            //_objcls.schid = Convert.ToInt32(rd_Building.SelectedItem.Value);
            _objcls.schid = Convert.ToInt32(Request.QueryString["Div"].ToString());
            _objbll.Generate_MS_Summary_ALL_Div(_objcls, _objdb);
        }
        private void Insert_Summary()
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clscassheet _objcls  = new _clscassheet();
            _clsproject  _objcls1 = new _clsproject();

            _objcls1.prjcode = lblprj.Text;
            _objbll.Update_RPTLogo(_objcls1, _objdb);
            _objbll.Clear_PkgGroup_Summ(_objdb);
            var _result = from _data in _dtsummary.AsEnumerable()
                          select _data;

            //int count = 0;
            foreach (var row in _result)
            {
                _objcls.sys      = Convert.ToInt32(row["SYS_ID"].ToString());
                _objdb.DBName    = "DB_" + lblprj.Text;
                _objcls.sys_mon  = _objbll.get_main_cat(_objcls, _objdb);
                _objcls.sys_name = _objbll.get_main_sys(_objcls, _objdb);
                _objcls.sch_name = row["SYS_NAME"].ToString();
                _objcls.quantity = Convert.ToInt32(row["QTY"].ToString());
                _objcls.per_com1 = Convert.ToDecimal(row["PRE_COMM_QTY"].ToString());
                _objcls.per_com2 = Convert.ToDecimal(row["COMM_QTY"].ToString());
                _objcls.per_com3 = Convert.ToDecimal(row["PFT_TOTAL"].ToString());
                _objcls.per_com4 = Convert.ToDecimal(row["PWRON_TOTAL"].ToString());
                _objcls.per_com5 = Convert.ToDecimal(row["FPT_TOTAL"].ToString());
                _objcls.per_com6 = Convert.ToDecimal(row["ARM_TOTAL"].ToString());
                _objdb.DBName    = "DBCML";
                _objbll.Generate_CASSummary_PKGGRP_CCAD_MEC(_objcls, _objdb);
            }
            //ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('" + count.ToString() + "');", true);
        }
예제 #5
0
        void summary()
        {
            Session["srv"] = "ALL";

            BLL_Dml      _objbll = new BLL_Dml();
            _database    _objdb  = new _database();
            _clsdocument _objcls = new _clsdocument();

            _objdb.DBName = "DBCML";
            _clsproject _objcls1 = new _clsproject();

            _objcls1.prjcode = lblprj.Text;
            _objbll.Update_RPTLogo(_objcls1, _objdb);
            _objbll.Clear_MSSummary(_objdb);
            _objdb.DBName = "DB_" + lblprj.Text;
            DataTable _dtable = _objbll.Load_MSStatus(_objdb);
            var       _status = from _data in _dtable.AsEnumerable()
                                select _data;

            foreach (var row in _status)
            {
                _objcls.status = row[0].ToString();
                _objcls.schid  = Convert.ToInt32(rd_Building.SelectedItem.Value);
                _objbll.Generate_MS_Summary_ALL_Div(_objcls, _objdb);
            }

            _objcls.status = "1";
            _objcls.schid  = Convert.ToInt32(rd_Building.SelectedItem.Value);
            _objbll.Generate_MS_Summary_ALL_Div(_objcls, _objdb);


            string _parm = "id=ms_" + GetDocNo_All() + "&idx=" + lblid.Text + "&Div=" + rd_Building.SelectedItem.Value.ToString();

            ScriptManager.RegisterStartupScript(this, typeof(string), "close", "parent.callcms('" + _parm + "','19');", true);
        }
        private void Generate_Summary_Graph()
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clscassheet _objcls  = new _clscassheet();
            _clsproject  _objcls1 = new _clsproject();

            _objcls1.prjcode = lblprj.Text;
            _objbll.Update_RPTLogo(_objcls1, _objdb);
            _objbll.Clear_CassummaryRpt(_objdb);
            var _result = from _data in _dtsummary.AsEnumerable()
                          select _data;

            //int count = 0;
            foreach (var row in _result)
            {
                _objcls.sys_mon  = row["SYS_NAME"].ToString();
                _objcls.qty      = row["QTY"].ToString();
                _objcls.per_com1 = Convert.ToDecimal(row["PER_COMPLETED"].ToString());
                _objcls.per_com2 = Convert.ToDecimal(row["PER_COMPLETED1"].ToString());
                _objcls.per_com3 = Convert.ToDecimal(row["PER_COMPLETED2"].ToString());
                _objcls.total    = Convert.ToDecimal(row["TOTAL"].ToString());
                _objcls.cate     = row["CODE"].ToString();
                _objcls.quantity = Convert.ToInt32(row["QTY"].ToString());
                _objbll.Generate_CASSummary_PKG_RPT(_objcls, _objdb);
                //count += 1;
            }
        }
        private void Generate_Logo()
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clsproject _objcls = new _clsproject();

            _objcls.prjcode = "CCAD";
            _objbll.Update_RPTLogo(_objcls, _objdb);
        }
        private void Generate_Summary()
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clsproject _objcls = new _clsproject();

            _objcls.prjcode = "CCAD";
            _objbll.Generate_CX_Log_Rpt(_objdb);
        }
        private void Get_ProjectInfo()
        {
            BLL_Dml     _objbll = new BLL_Dml();
            _clsproject _objcls = new _clsproject();
            _database   _objdb  = new _database();

            _objdb.DBName  = "DBCML";
            _objcls.prj_id = 7;
            DataTable _dt = _objbll.Get_ProjectInformation(_objcls, _objdb);

            lblprj.Text = _dt.Rows[0].ItemArray[0].ToString();
        }
예제 #10
0
        private void Generate_Reports1(string _rpt)
        {
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo  crtableLogoninfo  = new TableLogOnInfo();
            ConnectionInfo  crConnectionInfo  = new ConnectionInfo();
            Tables          CrTables;
            BLL_Dml         _objbll = new BLL_Dml();
            _database       _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clsproject _objcls1 = new _clsproject();

            _objcls1.prjcode = lblprj.Text;
            _objbll.Update_RPTLogo(_objcls1, _objdb);


            if (_rpt == "msr")
            {
                mydiv.Visible = false;
                //if (lblprj.Text == "12761")
                //    cryRpt.Load(Server.MapPath("ms_schedule_summary1.rpt"));
                //else
                cryRpt.Load(Server.MapPath("ms_schedule_summary2.rpt"));
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
                cryRpt.SetParameterValue("srv", (string)Session["srv"]);
                cryRpt.SetParameterValue("sys", (string)Session["sys"]);
                cryRpt.SetParameterValue("sts", (string)Session["sts"]);
            }

            crConnectionInfo.ServerName   = "37.61.235.103";
            crConnectionInfo.DatabaseName = "DB_" + lblprj.Text;
            crConnectionInfo.UserID       = "sa";
            crConnectionInfo.Password     = "******";
            CrTables = cryRpt.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }

            //CrystalReportViewer1.ParameterFieldInfo = paramFields;
            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.DataBind();
            //CrystalReportViewer1.RefreshReport();
            //CrystalReportViewer1.PageZoomFactor = 200;
            Session["Report"] = cryRpt;
        }
        private void GENERATE_SUMMARY(int sch_id)
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clsproject _objcls1 = new _clsproject();

            _objcls1.prjcode = lblprj.Text;
            _objbll.Update_RPTLogo(_objcls1, _objdb);
            _clscassheet _objcls = new _clscassheet();

            _objdb.DBName = "DB_" + lblprj.Text;
            _objcls.sch   = sch_id;
            _objbll.GENERATE_PACKAGE_SUMMARY(_objcls, _objdb);
        }
예제 #12
0
        protected void btnadd_Click(object sender, EventArgs e)
        {
            if (txtname.Text.Length <= 0)
            {
                return;
            }
            BLL_Dml     _objbll = new BLL_Dml();
            _clsproject _objcls = new _clsproject();
            _database   _objdb  = new _database();

            _objdb.DBName   = "DBCML";
            _objcls.company = txtname.Text;
            _objcls.prjcode = drproject.SelectedItem.Value;
            _objbll.Create_Company(_objcls, _objdb);
            ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('Company Created');", true);
            txtname.Text = String.Empty;
        }
        private void GENERATE_SUMMARY(string _bzone, string _flvl)
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clsproject _objcls1 = new _clsproject();

            _objcls1.prjcode = lblprj.Text;
            _objbll.Update_RPTLogo(_objcls1, _objdb);
            _objdb.DBName = "DB_" + lblprj.Text;
            _clscassheet _objcls = new _clscassheet();

            _objcls.b_zone  = _bzone;
            _objcls.f_level = _flvl;
            _objbll.GENERATE_PROJECT_SUMMARY(_objcls, _objdb);
        }
        private void Insert_Prj_Company()
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "dbCML";
            _clsproject _clsobj = new _clsproject();

            _clsobj.prjcode = prjcode.Text;
            foreach (ListItem _itm in chkcom.Items)
            {
                if (_itm.Selected == true)
                {
                    _clsobj.com_id = Convert.ToInt32(_itm.Value);
                    _objbll.Create_Prj_Company(_clsobj, _objdb);
                }
            }
        }
        void LoadProject_Information()
        {
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

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

            _objcls.prj_id = Convert.ToInt32(ddlproject.SelectedItem.Value);
            DataTable dt = _objbll.Get_ProjectInformation(_objcls, _objdb);

            CheckBoxList1.Items.Clear();

            foreach (DataRow dr in dt.Rows)
            {
                CheckBoxList1.Items.Add(new ListItem("CMS", dr["cms"].ToString(), (dr["cms"].ToString() == "True" ? true : false)));
                CheckBoxList1.Items.Add(new ListItem("DMS", dr["Dms"].ToString(), (dr["Dms"].ToString() == "True"?true:false)));
                CheckBoxList1.Items.Add(new ListItem("TMS", dr["tms"].ToString(), (dr["tms"].ToString() == "True" ? true : false)));
            }
        }
예제 #16
0
        private void uploadFiles()
        {
            HttpFileCollection hfc     = Request.Files;
            BLL_Dml            _objbll = new BLL_Dml();
            _database          _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clsproject _objcls = new _clsproject();

            for (int i = 0; i < hfc.Count; i++)
            {
                HttpPostedFile hpf       = hfc[i];
                string         _fileName = System.IO.Path.GetFileName(hpf.FileName);
                FileInfo       _Ffile    = new FileInfo(Server.MapPath("images") + "\\" + drproject.SelectedItem.Value + "logo.jpg");
                if (_Ffile.Exists == true)
                {
                    _Ffile.Delete();
                }
                if (hpf.ContentLength > 0)
                {
                    hpf.SaveAs(Server.MapPath("images") + "\\" + System.IO.Path.GetFileName(hpf.FileName));
                    FileInfo _info1 = new FileInfo(Server.MapPath("images") + "\\" + System.IO.Path.GetFileName(hpf.FileName));
                    if (_info1.Exists == true)
                    {
                        _info1.MoveTo(Server.MapPath("images") + "\\" + drproject.SelectedItem.Value + "logo.jpg");
                    }
                    //ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('Documents Uploaded!');", true);
                }
            }
            string       _path = "images/" + drproject.SelectedItem.Value + "logo.jpg";
            FileStream   fs    = new FileStream(Server.MapPath(_path), FileMode.Open, FileAccess.Read);
            BinaryReader br    = new BinaryReader(fs);

            byte[] _image = br.ReadBytes((int)fs.Length);
            br.Close();
            fs.Close();
            _objcls.prjcode = drproject.SelectedItem.Value;
            _objcls.logo    = _image;
            _objbll.Update_PrjLogo(_objcls, _objdb);
            ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('Completed!');", true);
        }
예제 #17
0
        private void Generate_Reports()
        {
            Generate_Rpt_Data();
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clsproject _objcls = new _clsproject();

            _objcls.prjcode = lblprj.Text;
            _objbll.Update_RPTLogo(_objcls, _objdb);

            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo  crtableLogoninfo  = new TableLogOnInfo();
            ConnectionInfo  crConnectionInfo  = new ConnectionInfo();
            Tables          CrTables;

            cryRpt.Load(Server.MapPath("Cas_TS.rpt"));
            crConnectionInfo.ServerName   = "37.61.235.103";
            crConnectionInfo.DatabaseName = "DBCML";
            crConnectionInfo.UserID       = "sa";
            crConnectionInfo.Password     = "******";
            CrTables = cryRpt.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }
            cryRpt.SetParameterValue("projectname", (string)Session["projectname"]);
            cryRpt.SetParameterValue("service", lblsrv.Text);
            cryRpt.SetParameterValue("estdate", Get_EstDate());
            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.DataBind();
            Session["Report"] = cryRpt;
        }
        protected void btnsave1_Click(object sender, EventArgs e)
        {
            BLL_Dml     _objbll = new BLL_Dml();
            _clsproject _objcls = new _clsproject();
            _database   _objdb  = new _database();

            _objdb.DBName = "DBCML";
            if (btnsave1.Text == "Save")
            {
                _objcls.com_id = 0;
                _objcls.action = 1;
            }
            else
            {
                _objcls.com_id = Convert.ToInt32((string)Session["com_id"]);
                _objcls.action = 2;
            }

            _objcls.comcd   = txt_comcd.Text;
            _objcls.company = txt_comname.Text;
            if (chkactive.Checked == true)
            {
                _objcls.status = true;
            }
            else
            {
                _objcls.status = false;
            }

            _objbll.Create_Company(_objcls, _objdb);
            ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('Completed');", true);
            txt_comname.Text = String.Empty;
            txt_comcd.Text   = String.Empty;
            load_Company();
            ModalPopupExtender1.Hide();
        }
        protected void update_project()
        {
            if (IsnullValidation() == true)
            {
                return;
            }
            BLL_Dml   _objbll = new BLL_Dml();
            _database _objdb  = new _database();

            _objdb.DBName = "dbCML";
            _clsproject _clsobj = new _clsproject();

            _clsobj.prjcode     = prjcode.Text;
            _clsobj.prjname     = prjname.Text;
            _clsobj.company     = dr_maincom.SelectedItem.Text;
            _clsobj.description = description.Text;
            _clsobj.user        = (string)Session["uid"];
            if (chkdms.Checked == true)
            {
                _clsobj.dms = true;
            }
            else
            {
                _clsobj.dms = false;
            }
            if (chkcms.Checked == true)
            {
                _clsobj.cms = true;
            }
            else
            {
                _clsobj.cms = false;
            }
            if (chktms.Checked == true)
            {
                _clsobj.tms = true;
            }
            else
            {
                _clsobj.tms = false;
            }
            if (chksns.Checked == true)
            {
                _clsobj.sns = true;
            }
            else
            {
                _clsobj.sns = false;
            }
            if (chktis.Checked == true)
            {
                _clsobj.tis = true;
            }
            else
            {
                _clsobj.tis = false;
            }
            _clsobj.loc  = txt_loc.Text;
            _clsobj.mode = Convert.ToInt32((string)Session["mode"]);
            _objbll._projectmaster(_clsobj, _objdb);
            Insert_Prj_Company();
            DB();
            load_projects();
            clear();
        }
예제 #20
0
        private void Generate_Reports(string _rpt)
        {
            bool _isNewProject = (Array.IndexOf(Constants.CMLTConstants.recentProjects, lblprj.Text) > -1) ? true : false;
            bool _hasBuilding  = (Array.IndexOf(Constants.CMLTConstants.hasBuilding, lblprj.Text) > -1) ? true : false;

            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo  crtableLogoninfo  = new TableLogOnInfo();
            ConnectionInfo  crConnectionInfo  = new ConnectionInfo();
            Tables          CrTables;
            BLL_Dml         _objbll = new BLL_Dml();
            _database       _objdb  = new _database();

            _objdb.DBName = "DBCML";
            _clsproject _objcls1 = new _clsproject();

            _objcls1.prjcode = lblprj.Text;
            _objbll.Update_RPTLogo(_objcls1, _objdb);
            _objdb.DBName = "DB_" + lblprj.Text;
            if (_rpt == "dr")
            {
                //string _path = "../images/" + lblprj.Text + "logo.jpg";
                //FileStream fs = new FileStream(Server.MapPath(_path), FileMode.Open, FileAccess.Read);
                //BinaryReader br = new BinaryReader(fs);
                //byte[] _image = br.ReadBytes((int)fs.Length);
                //br.Close();
                //fs.Close();
                _clsdocreview _objcls = new _clsdocreview();
                _objcls.project_code = (string)Session["projectname"];
                _objcls.dr_id        = Convert.ToInt32(lblid.Text);
                _objbll.Generate_DRReport(_objcls, _objdb);
                if (lblprj.Text == "14211")
                {
                    cryRpt.Load(Server.MapPath("drreport_kaia.rpt"));
                }
                if (lblprj.Text == "ARSD")
                {
                    cryRpt.Load(Server.MapPath("drdetails_svd.rpt"));
                }
                else if (_isNewProject)
                {
                    cryRpt.Load(Server.MapPath("drView.rpt"));
                }
                else
                {
                    cryRpt.Load(Server.MapPath("drreport.rpt"));
                }
            }
            else if (_rpt == "so")
            {
                _clsSO _objcls = new _clsSO();
                _objcls.project_code = (string)Session["projectname"];
                _objcls.so_id        = Convert.ToInt32(lblid.Text);
                _objbll.Generate_SOReport(_objcls, _objdb);
                Generate_SOIMG();
                if (lblprj.Text == "14211")
                {
                    cryRpt.Load(Server.MapPath("soreport_kaia.rpt"));
                }
                else if (lblprj.Text == "ARSD")
                {
                    cryRpt.Load(Server.MapPath("sodetails_svd.rpt"));
                }
                else if (_isNewProject)
                {
                    cryRpt.Load(Server.MapPath("soreport_new.rpt"));
                }
                else
                {
                    cryRpt.Load(Server.MapPath("soreport.rpt"));
                }
            }
            else if (_rpt == "pr")
            {
                _objdb.DBName   = "DBCML";
                _objdb.Dataname = "DB_" + lblprj.Text;
                _objdb.project  = (string)Session["projectname"];
                _objbll.Generate_PRG_RPT(_objdb);
                cryRpt.Load(Server.MapPath("cpms_report.rpt"));
            }
            else if (_rpt == "dlog1")
            {
                _objdb.DBName  = "DB_" + lblprj.Text;
                _objdb.rpt     = 0;
                _objdb.Logname = "";
                _objbll.Generate_DR_SO_RPT(_objdb);
                if (lblprj.Text == "14211")
                {
                    cryRpt.Load(Server.MapPath("drso_kaia.rpt"));
                }
                else
                {
                    cryRpt.Load(Server.MapPath("drso.rpt"));
                }
                cryRpt.SetParameterValue("service", "All");
                cryRpt.SetParameterValue("rev", "All");
                cryRpt.SetParameterValue("iss", "All");
                cryRpt.SetParameterValue("sts", "All");
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
            }
            else if (_rpt == "dlog")
            {
                mydiv.Visible = false;
                _objdb.DBName = "DB_" + lblprj.Text;
                if (lblprj.Text == "BNGA")
                {
                    _objdb.rpt = 2;
                }
                else
                {
                    _objdb.rpt = 0;
                }
                _objdb.Logname = lblid.Text;
                _objbll.Generate_DR_SO_RPT(_objdb);
                if (lblprj.Text == "14211")
                {
                    cryRpt.Load(Server.MapPath("drso_kaia.rpt"));
                    SelectionFormula(cryRpt, (string)Session["fsrv"], (string)Session["frev"], (string)Session["fiss"], (string)Session["fsts"]);
                }
                else if (_isNewProject)
                {
                    cryRpt.Load(Server.MapPath("drLog_New.rpt"));
                    cryRpt.SetParameterValue("building", (string)Session["fbui"]);
                    SelectFormulaWithBuilding(cryRpt, (string)Session["fsrv"], (string)Session["frev"], (string)Session["fiss"], (string)Session["fsts"], (string)Session["fbui"]);
                }
                else if (lblprj.Text == "ARSD")
                {
                    cryRpt.Load(Server.MapPath("drsolog_svd.rpt"));
                    SelectionFormula(cryRpt, (string)Session["fsrv"], (string)Session["frev"], (string)Session["fiss"], (string)Session["fsts"]);
                }
                else
                {
                    cryRpt.Load(Server.MapPath("drso.rpt"));
                    SelectionFormula(cryRpt, (string)Session["fsrv"], (string)Session["frev"], (string)Session["fiss"], (string)Session["fsts"]);
                }
                cryRpt.SetParameterValue("service", (string)Session["fsrv"]);
                cryRpt.SetParameterValue("rev", (string)Session["frev"]);
                cryRpt.SetParameterValue("iss", (string)Session["fiss"]);
                cryRpt.SetParameterValue("sts", (string)Session["fsts"]);
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
            }
            else if (_rpt == "som")
            {
                _objdb.DBName  = "DB_" + lblprj.Text;
                _objdb.rpt     = 1;
                _objdb.Logname = "";
                _objbll.Generate_DR_SO_RPT(_objdb);
                cryRpt.Load(Server.MapPath("drso.rpt"));
                cryRpt.SetParameterValue("service", "All");
                cryRpt.SetParameterValue("rev", "All");
                cryRpt.SetParameterValue("iss", "All");
                cryRpt.SetParameterValue("sts", "All");
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
            }
            else if (_rpt == "cmtlogdr")
            {
                mydiv.Visible = false;

                _clsSO _objcls = new _clsSO();
                _objcls.mode = 0;
                DataSet ds = new DataSet();
                ds = _objbll.Load_DR_SO_CommentLog(_objcls, _objdb);
                cryRpt.Load(Server.MapPath("drCommentLog.rpt"));

                cryRpt.Database.Tables["DR_CMMNT_RPT"].SetDataSource(ds.Tables[0]);

                cryRpt.Subreports[0].Database.Tables[0].SetDataSource(ds.Tables[1]);

                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
            }

            else if (_rpt == "socmtlog")
            {
                mydiv.Visible = false;

                _clsSO _objcls = new _clsSO();
                _objcls.mode = (_rpt == "socmtlog" ? 1 : 0);
                DataSet ds = new DataSet();
                ds = _objbll.Load_DR_SO_CommentLog(_objcls, _objdb);


                ds.Tables[1].Columns.Add("Image", typeof(byte[]));
                FileStream   fs;
                BinaryReader br;
                byte[]       _image;

                //int ins=0;
                for (int ins = 0; ins <= ds.Tables[1].Rows.Count - 1; ins += 1)
                {
                    string _path = ds.Tables[1].Rows[ins]["Photo"].ToString();

                    if (string.IsNullOrEmpty(_path))
                    {
                        continue;
                    }
                    fs     = new FileStream(Server.MapPath(_path), FileMode.Open, FileAccess.Read);
                    br     = new BinaryReader(fs);
                    _image = br.ReadBytes((int)fs.Length);

                    ds.Tables[1].Rows[ins]["Image"] = _image;

                    ds.Tables[1].AcceptChanges();
                }


                cryRpt.Load(Server.MapPath("SoCommentLog.rpt"));

                cryRpt.Database.Tables["SO_CMMNT_RPT"].SetDataSource(ds.Tables[0]);

                cryRpt.Subreports[0].Database.Tables[0].SetDataSource(ds.Tables[1]);
                //cryRpt.Subreports[1].Database.Tables[0].SetDataSource(ds.Tables[2]);
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
            }
            else if (_rpt == "som1")
            {
                mydiv.Visible  = false;
                _objdb.DBName  = "DB_" + lblprj.Text;
                _objdb.rpt     = 1;
                _objdb.Logname = "";
                _objbll.Generate_DR_SO_RPT(_objdb);
                if (lblprj.Text == "14211")
                {
                    cryRpt.Load(Server.MapPath("drso_kaia.rpt"));
                }
                else if (_isNewProject && _hasBuilding)
                {
                    DataSet   _ds = new DataSet();
                    DataTable _dt = GetData();
                    _ds.Tables.Add(_dt);
                    //_ds.WriteXmlSchema(Server.MapPath("") + "\\soreport.xml");
                    cryRpt.Load(Server.MapPath("SO_New.rpt"));
                    cryRpt.Database.Tables[0].SetDataSource(_ds.Tables[0]);
                    cryRpt.SetParameterValue("building", (string)Session["fbui"]);
                }
                else if (lblprj.Text == "ARSD")
                {
                    cryRpt.Load(Server.MapPath("drsolog_svd.rpt"));
                }
                else
                {
                    cryRpt.Load(Server.MapPath("drso.rpt"));
                }
                cryRpt.SetParameterValue("service", (string)Session["fsrv"]);
                cryRpt.SetParameterValue("rev", (string)Session["frev"]);
                cryRpt.SetParameterValue("iss", (string)Session["fiss"]);
                cryRpt.SetParameterValue("sts", (string)Session["fsts"]);
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);

                if (_isNewProject && _hasBuilding)
                {
                    SelectionFormula_New(cryRpt, (string)Session["fsrv"], (string)Session["frev"], (string)Session["fiss"], (string)Session["fsts"], (string)Session["fbui"]);
                }
                else
                {
                    SelectionFormula(cryRpt, (string)Session["fsrv"], (string)Session["frev"], (string)Session["fiss"], (string)Session["fsts"]);
                }
            }
            else if (_rpt == "uso")
            {
                mydiv.Visible = false;
                _objdb.DBName = "DB_" + lblprj.Text;
                _objdb.rpt    = 1;
                _objbll.Generate_DR_SO_RPT(_objdb);
                cryRpt.Load(Server.MapPath("uso_log.rpt"));
            }
            else if (_rpt == "cp")
            {
                _objdb.DBName   = "DBCML";
                _objdb.Dataname = "DB_" + lblprj.Text;
                _objdb.project  = (string)Session["projectname"];
                _objbll.Generate_CP_RPT(_objdb);
                cryRpt.Load(Server.MapPath("cpms_report.rpt"));
                //cryRpt.Load(Server.MapPath("comment_rpt.rpt"));
                //cryRpt.SetParameterValue("project", (string)Session["projectname"]);
            }
            else if (_rpt == "msc")
            {
                _objdb.DBName = "DB_" + lblprj.Text;
                if (lblprj.Text == "HMIM")
                {
                    _clscassheet _objcls = new _clscassheet();
                    _objcls.build_id = Convert.ToInt32(Session["building_id"].ToString());
                    _objbll.Gen_MSComment_Rpt(_objcls, _objdb);
                    cryRpt.Load(Server.MapPath("ms_comments_rpt 1.rpt"));
                    cryRpt.SetParameterValue("bldng", "BUILDING : " + (string)Session["building"]);
                }
                else
                {
                    _objbll.Gen_MSComment_Rpt(_objdb);
                    cryRpt.Load(Server.MapPath("ms_comments_rpt.rpt"));
                }
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
                cryRpt.SetParameterValue("ser", drservices.SelectedItem.Text);
                cryRpt.SetParameterValue("sys", drpackages.SelectedItem.Text);
                cryRpt.SetParameterValue("typ", drtype.SelectedItem.Text);
                MSC_SelectionFormula(cryRpt, drservices.SelectedItem.Text, drpackages.SelectedItem.Text, drtype.SelectedItem.Text);
            }
            else if (_rpt == "msr")
            {
                mydiv.Visible = false;
                //if (lblprj.Text == "12761")
                //    cryRpt.Load(Server.MapPath("ms_schedule_summary1.rpt"));
                //else
                cryRpt.Load(Server.MapPath("ms_schedule_summary2.rpt"));
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
                cryRpt.SetParameterValue("srv", (string)Session["srv"]);
                cryRpt.SetParameterValue("sys", (string)Session["sys"]);
                cryRpt.SetParameterValue("typ", (string)Session["typ"]);
                cryRpt.SetParameterValue("sts", (string)Session["sts"]);
            }
            else if (_rpt == "mss")
            {
                //_objdb.DBName = "DB_" + lblprj.Text;
                //_objbll.Gen_MS_Schedule_Summary(_objdb);
                mydiv.Visible = false;
                if (lblprj.Text == "12761")
                {
                    cryRpt.Load(Server.MapPath("ms_schedule_summary1.rpt"));
                }

                else if (lblprj.Text == "HMIM" || lblprj.Text == "ABS")
                {
                    cryRpt.Load(Server.MapPath("ms_schedule_summary3.rpt"));
                    cryRpt.SetParameterValue("bldng", (string)Session["building"]);
                }
                else
                {
                    cryRpt.Load(Server.MapPath("ms_schedule_summary.rpt"));
                }
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
                cryRpt.SetParameterValue("srv", (string)Session["srv"]);
                cryRpt.SetParameterValue("sys", (string)Session["sys"]);
                cryRpt.SetParameterValue("typ", (string)Session["typ"]);
                cryRpt.SetParameterValue("sts", (string)Session["sts"]);
                MSS_SelectionFormula(cryRpt, (string)Session["srv"], (string)Session["sys"], (string)Session["typ"], (string)Session["sts"]);
            }
            else if (_rpt == "doc_comm")
            {
                mydiv.Visible = false;
                cryRpt.Load(Server.MapPath("comment_rpt.rpt"));
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
            }
            else if (_rpt == "cas")
            {
                _objdb.DBName    = "DBCML";
                _objdb.Dataname  = "DB_" + lblprj.Text;
                _objdb.photo_rpt = null;
                _objdb.project   = (string)Session["projectname"];
                _objdb.Datapath  = lblprj.Text;
                _objdb.rpt       = Convert.ToInt32((string)Session["sch_id"]);
                _objdb.cas       = (string)Session["sch_id"];
                _objbll.Generate_CAS_RPT(_objdb);
                // _objbll.CAS_PKG_SUM_RPT(_objdb);
                if ((string)Session["sch_id"] == "1" || (string)Session["sch_id"] == "5")
                {
                    cryRpt.Load(Server.MapPath("cas_lv.rpt"));
                }
                else if ((string)Session["sch_id"] == "2")
                {
                    cryRpt.Load(Server.MapPath("cas_mv.rpt"));
                }
                else if ((string)Session["sch_id"] == "3")
                {
                    cryRpt.Load(Server.MapPath("cas_tx.rpt"));
                }
                else if ((string)Session["sch_id"] == "6")
                {
                    cryRpt.Load(Server.MapPath("cas_e_l.rpt"));
                }
                else if ((string)Session["sch_id"] == "8")
                {
                    cryRpt.Load(Server.MapPath("cas_mec.rpt"));
                }
                else if ((string)Session["sch_id"] == "17")
                {
                    cryRpt.Load(Server.MapPath("cas_ph1.rpt"));
                }
                else if ((string)Session["sch_id"] == "18")
                {
                    cryRpt.Load(Server.MapPath("cas_ph2.rpt"));
                }
                else if ((string)Session["sch_id"] == "19")
                {
                    cryRpt.Load(Server.MapPath("cas_ph3.rpt"));
                }
                else if ((string)Session["sch_id"] == "20")
                {
                    cryRpt.Load(Server.MapPath("cas_bms.rpt"));
                }
                cryRpt.SetParameterValue("bz", "All");
                cryRpt.SetParameterValue("cat", "All");
                cryRpt.SetParameterValue("fl", "All");
                cryRpt.SetParameterValue("ff", "All");
            }
            else if (_rpt == "ams")
            {
                cryRpt.Load(Server.MapPath("../AMS/tasklist.rpt"));
            }
            else if (_rpt == "SODR_PDF")
            {
                mydiv.Visible = false;
                _objdb.DBName = "DB_" + lblprj.Text;

                if (!String.IsNullOrEmpty(Request.QueryString["dtype"]))
                {
                    _objdb.rpt = Convert.ToInt16(Request.QueryString["dtype"].ToString());
                }
                _objdb.Logname = lblid.Text;
                _objbll.Generate_DR_SO_RPT_PDF(_objdb);

                cryRpt.Load(Server.MapPath("drso_pdf.rpt"));
                SelectionFormula(cryRpt, (string)Session["fsrv"], (string)Session["frev"], (string)Session["fiss"], (string)Session["fsts"]);

                cryRpt.SetParameterValue("service", (string)Session["fsrv"]);
                cryRpt.SetParameterValue("rev", (string)Session["frev"]);
                cryRpt.SetParameterValue("iss", (string)Session["fiss"]);
                cryRpt.SetParameterValue("sts", (string)Session["fsts"]);
                cryRpt.SetParameterValue("project", (string)Session["projectname"]);
            }


            if (_rpt != "som1" || lblprj.Text != "HMIM")
            {
                crConnectionInfo.ServerName   = Constants.CMLTConstants.serverName;
                crConnectionInfo.DatabaseName = Constants.CMLTConstants.dbName;
                crConnectionInfo.UserID       = Constants.CMLTConstants.dbUserName;
                crConnectionInfo.Password     = Constants.CMLTConstants.dbPassword;
                CrTables = cryRpt.Database.Tables;
                foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
                {
                    crtableLogoninfo = CrTable.LogOnInfo;
                    crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                    CrTable.ApplyLogOnInfo(crtableLogoninfo);
                }
            }

            //CrystalReportViewer1.ParameterFieldInfo = paramFields;


            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.DataBind();



            //CrystalReportViewer1.RefreshReport();
            //CrystalReportViewer1.PageZoomFactor = 200;
            Session["Report"] = cryRpt;

            _clsuser _cls = new _clsuser();

            _cls.uid          = (string)Session["uid"];
            _cls.project_code = lblprj.Text;
            _cls.mode         = 2;
            _objdb.DBName     = "DBCML";
            string _access = _objbll.Get_CMSAccess(_cls, _objdb);

            if (_access == "Read Only")
            {
                CrystalReportViewer1.HasExportButton = false;
            }
        }
예제 #21
0
        protected void btnmsdview_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(drservices.SelectedItem.Value) == 0 || drservices.SelectedItem.Text == "All")
            {
                Ms_summaryAll();
            }
            else
            {
                Session["srv"] = drservices.SelectedItem.Text;
                BLL_Dml      _objbll = new BLL_Dml();
                _database    _objdb  = new _database();
                _clsdocument _objcls = new _clsdocument();
                _objdb.DBName = "DBCML";
                _clsproject _objcls1 = new _clsproject();
                _objcls1.prjcode = lblprj.Text;
                _objbll.Update_RPTLogo(_objcls1, _objdb);
                _objbll.Clear_MSSummary(_objdb);
                _objdb.DBName = "DB_" + lblprj.Text;
                DataTable _dtable = _objbll.Load_MSStatus(_objdb);
                var       _status = from _data in _dtable.AsEnumerable()
                                    select _data;
                foreach (var row in _status)
                {
                    _objcls.doc_id = Convert.ToInt32(drservices.SelectedItem.Value);
                    _objcls.status = row[0].ToString();

                    if (lblprj.Text == "HMIM" || lblprj.Text == "ABS")
                    {
                        _objcls.schid = Convert.ToInt32(Request.QueryString["Div"].ToString());
                        _objbll.Generate_MS_Summary_Div(_objcls, _objdb);

                        lbltotal.Text = GetDocNo_All();
                    }
                    else
                    {
                        _objbll.Generate_MS_Summary(_objcls, _objdb);
                    }
                }
                _objcls.doc_id = Convert.ToInt32(drservices.SelectedItem.Value);
                //if (lblprj.Text == "12761")
                //{
                //    _objcls.status = "-1";
                //    _objbll.Generate_MS_Summary(_objcls, _objdb);
                //}

                _objcls.status = "1";

                if (lblprj.Text == "HMIM" || lblprj.Text == "ABS")
                {
                    _objbll.Generate_MS_Summary_ALL_Div(_objcls, _objdb);
                }
                else
                {
                    _objbll.Generate_MS_Summary(_objcls, _objdb);
                }
            }


            Generate_Reports();
            //ScriptManager.RegisterStartupScript(this, typeof(string), "close", "alert('" + dr_msservice.SelectedItem.Value + "');", true);
        }