예제 #1
0
 protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         int id = Convert.ToInt32(e.CommandArgument);
         if (YuyueInfoOperator.Delete(id))
         {
             WebTools.Alert(this, "已经撤销申请成功!");
             this.ReBind();
         }
         else
         {
             WebTools.Alert(this, "无法撤销审核过的申请!");
         }
     }
 }
    protected void cboJoints_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            IsoIdField.Value  = WebTools.GetExpr("ISO_ID", "PIP_SPOOL_JOINTS", "JOINT_ID=" + cboJoints.SelectedValue.ToString());
            matId1Field.Value = WebTools.GetExpr("MAT_ID1", "VIEW_JOINT_ITEM", "JOINT_ID=" + cboJoints.SelectedValue.ToString());
            matId2Field.Value = WebTools.GetExpr("MAT_ID2", "VIEW_JOINT_ITEM", "JOINT_ID=" + cboJoints.SelectedValue.ToString());

            bomId1Field.Value = WebTools.GetExpr("ITEM_1", "VIEW_JOINT_ITEM", "JOINT_ID=" + cboJoints.SelectedValue.ToString());
            bomId2Field.Value = WebTools.GetExpr("ITEM_2", "VIEW_JOINT_ITEM", "JOINT_ID=" + cboJoints.SelectedValue.ToString());
            ddHeatNo1.Enabled = true;
            ddHeatNo2.Enabled = true;
            ddHeatNo1.DataBind();
            ddHeatNo2.DataBind();
        }
    }
    protected void txtAutoMatCode_TextChanged(object sender, Telerik.Web.UI.AutoCompleteTextEventArgs e)
    {
        HiddenMatID.Value = WebTools.GetExpr("MAT_ID", "PIP_MAT_STOCK", " WHERE MAT_CODE1='" + txtAutoMatCode.Entries[0].Text + "'");
        txtReqQty.Text    = WebTools.GetExpr("BAL_ISSUE", "VIEW_BULK_PAINT_ISSUE_BAL", " WHERE PAINT_ID='" + HiddenPaintID.Value + "' AND MAT_ID = '" + HiddenMatID.Value + "'");

        string item_nam = WebTools.GetExpr("ITEM_NAM", "VIEW_STOCK", " WHERE MAT_ID = '" + HiddenMatID.Value + "'");

        if (item_nam.ToUpper() == "PIPE" || item_nam.ToUpper() == "PIPES")
        {
            txtPipePiece.Enabled = true;
        }
        else
        {
            txtPipePiece.Enabled = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Master.HeadingMessage = "Daily Fitup Report";

        if (!WebTools.UserInRole("PIP_WIC_UPDATE"))
        {
            NotificationBox.show_error("Access Denied!");
            btnSubmit.Enabled = false;
            return;
        }

        if (!IsPostBack)
        {
            unqPartField.Value = WebTools.GetExpr("NVL(UNIQUE_PART,'N')", "PROJECT_SETTING", "PROJECT_ID=" + Session["PROJECT_ID"].ToString());
        }
    }
예제 #5
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!WebTools.UserInRole("TPK_DELETE"))
     {
         Master.ShowWarn("Access Denied!");
         return;
     }
     if (isomeGridView.SelectedIndexes.Count == 0)
     {
         Master.ShowWarn("Select the isometric!");
         return;
     }
     Master.ShowWarn("Proceed delete the selected isometric?");
     btnYes.Visible = true;
     btnNo.Visible  = true;
 }
예제 #6
0
    private void set_req_no1()
    {
        try
        {
            string sc_id   = WebTools.GetExpr("SUB_CON_ID", "SUB_CONTRACTOR", " WHERE SUB_CON_ID=" + ddSubcon.SelectedValue.ToString());
            string prefix  = "MAT-RESERVE-";
            string sc_name = WebTools.GetExpr("SHORT_NAME", "SUB_CONTRACTOR", " WHERE SUB_CON_ID=" + sc_id);

            txtReserveNo.Text = WebTools.NextSerialNo("MAT_RESERVE", "MAT_RES_NO", prefix + sc_name + "-", 4,
                                                      " MAT_RES_SUBCON=" + ddSubcon.SelectedValue.ToString());
        }
        catch (Exception ex)
        {
            Master.show_error(ex.Message);
        }
    }
예제 #7
0
        public ActionResult Version(VersionSettingModel model)
        {
            VersionSetting entity = new VersionSetting();

            WebTools.CopyProperties(model, entity);
            entity.Mandatory = model.MandatoryStr == "on";
            _settingService.SaveSetting(entity, v => v.VersionCode, false);
            _settingService.SaveSetting(entity, v => v.VersionName, false);
            _settingService.SaveSetting(entity, v => v.UpdateTime, false);
            _settingService.SaveSetting(entity, v => v.IosDownloadUrl, false);
            _settingService.SaveSetting(entity, v => v.Mandatory, false);
            _settingService.SaveSetting(entity, v => v.DownloadUrl, false);
            _settingService.SaveSetting(entity, v => v.Description, false);
            _settingService.ClearCache();
            return(Ok());
        }
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!WebTools.UserInRole("MM_DELETE"))
     {
         Master.ShowWarn("Access Denied!");
         return;
     }
     if (returnGridView.SelectedIndex < 0)
     {
         Master.ShowMessage("Select the entire row!");
         return;
     }
     btnYes.Visible = true;
     btnNo.Visible  = true;
     Master.ShowWarn("Proceed delete the selected row!?");
 }
예제 #9
0
 protected void btnYes_Click(object sender, EventArgs e)
 {
     try
     {
         string tpk_item_id = WebTools.GetExpr("TPK_ITEM_ID", "TPK_ISOME", "  WHERE  TPK_ID=" + isomeGridView.SelectedValues["TPK_ID"].ToString()
                                               + "  AND ISO_ID=" + isomeGridView.SelectedValues["ISO_ID"].ToString());
         string query = "DELETE FROM TPK_ISOME WHERE TPK_ITEM_ID=" + tpk_item_id;
         WebTools.exec_non_qry(query);
         isomeGridView.DataBind();
         Master.ShowMessage("Isometric deleted from Test Package !");
     }
     catch (Exception ex)
     {
         Master.ShowWarn(ex.Message);
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!WebTools.UserInRole("MM_SELECT"))
     {
         Response.Redirect("~/ErrorPages/NoAccess.htm");
         return;
     }
     if (!IsPostBack)
     {
         Master.HeadingMessage = "Material Transfer";
         if (Session["MTN_FILTER"] != null)
         {
             txtSearch.Text = Session["MTN_FILTER"].ToString();
         }
     }
 }
예제 #11
0
    public static bool UserInRole(string role)
    {
        string projid   = HttpContext.Current.Session["PROJECT_ID"].ToString();
        string username = HttpContext.Current.Session["USER_NAME"].ToString();
        string userid   = WebTools.GetExpr("USER_ID", "VIEW_USERS_ROLE", "PROJECT_ID=" + projid +
                                           " AND UPPER(USER_NAME)='" + username.ToUpper() + "' AND UPPER(ROLE_NAME)='" + role.ToUpper() + "'");

        if (userid.Length > 0)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
예제 #12
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!WebTools.UserInRole("MM_DELETE"))
     {
         Master.ShowWarn("Access Denied!");
         return;
     }
     if (LooseIssueGridView.SelectedIndexes.Count == 0)
     {
         Master.ShowMessage("Select the JC!");
         return;
     }
     btnYes.Visible = true;
     btnNo.Visible  = true;
     Master.ShowWarn("Proceed delete selecetd JC!");
 }
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!WebTools.UserInRole("TPK_DELETE"))
     {
         Master.ShowWarn("Access Denied!");
         return;
     }
     if (TransGridView.SelectedIndexes.Count == 0)
     {
         Master.ShowMessage("Select the transmittal!");
         return;
     }
     btnYes.Visible = true;
     btnNo.Visible  = true;
     Master.ShowWarn("Proceed delete the transmittal?");
 }
예제 #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Master.HeadingMessage           = "Site Simulation Settings";
         rdoDwgStatus.SelectedValue      = WebTools.GetExpr("DWG_STATUS", "SIMULATION_SETTING", "1=1");
         rdoHoldStatus.SelectedValue     = WebTools.GetExpr("EXCLUDE_HOLD", "SIMULATION_SETTING", "1=1");
         rdoSpoolSFR.SelectedValue       = WebTools.GetExpr("ON_SFR_FIRST", "SIMULATION_SETTING", "1=1");
         rdoAGUG.SelectedValue           = WebTools.GetExpr("AGUG", "SIMULATION_SETTING", "1=1");
         rdoSelectedIsome.SelectedValue  = WebTools.GetExpr("ON_SELECTED_ISOME", "SIMULATION_SETTING", "1=1");
         rdoMaterialSource.SelectedValue = WebTools.GetExpr("MATERIAL_SOURCE", "SIMULATION_SETTING", "1=1");
         rdoUseCommonStore.SelectedValue = WebTools.GetExpr("USE_COMMON_STORE", "SIMULATION_SETTING", "1=1");
         rdoSelectedIsome_SelectedIndexChanged(sender, e);
         rdoPriority.SelectedValue = WebTools.GetExpr("SML_PRIORITY", "SIMULATION_SETTING", "1=1");
     }
 }
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!WebTools.UserInRole("MM_DELETE"))
     {
         Master.ShowWarn("Access Denied!");
         return;
     }
     if (itemsGridView.SelectedIndex < 0)
     {
         Master.ShowWarn("Select the po item!");
         return;
     }
     Master.ShowWarn("Proceed delete the selected po item?");
     btnYes.Visible = true;
     btnNo.Visible  = true;
 }
    protected void spoolsGridView_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        string ID1     = (e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["WO_ID"].ToString();
        string ID2     = (e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["SPL_ID"].ToString();
        string user_id = WebTools.GetExpr("USER_ID", "USERS", " USER_NAME='" + Session["USER_NAME"] + "'");

        if (user_id.Length > 0)
        {
            string query = "UPDATE PIP_WORK_ORD_SPOOL SET USER_ID='" + user_id + "', USER_SOURCE='UI' WHERE WO_ID='" + ID1 + "' AND SPL_ID='" + ID2 + "'";
            WebTools.ExeSql(query);
        }
        else
        {
            Response.Redirect("~/LoginPage.aspx");
        }
    }
예제 #17
0
    private void set_req_no()
    {
        string sc_name = WebTools.GetExpr("SHORT_NAME", "SUB_CONTRACTOR", " WHERE SUB_CON_ID=" +
                                          cboSubcon.SelectedValue.ToString());

        try
        {
            txtJntPaintNo.Text = General_Functions.NextSerialNo("PIP_JOINT_PAINT", "JNT_PNT_NO", "JPNT-" + sc_name + "-",
                                                                4, " WHERE PROJECT_ID=" + Session["PROJECT_ID"] +
                                                                " AND SC_ID=" + cboSubcon.SelectedValue.ToString());
        }
        catch (Exception ex)
        {
            Master.show_error(ex.Message + ", " + "Check your request numbers format!");
        }
    }
 private void set_pnt_no()
 {
     try
     {
         string job_code   = WebTools.GetExpr("JOB_CODE", "PROJECT_INFORMATION", " WHERE PROJECT_ID = '" + Session["PROJECT_ID"].ToString() + "'");
         string short_name = WebTools.GetExpr("SHORT_NAME", "SUB_CONTRACTOR", " WHERE SUB_CON_ID='" + cboSubcon.SelectedValue + "'");
         string prefix     = job_code + "-SPL-PICKLING-" + short_name + "-";
         txtTransNo.Text =
             General_Functions.NextSerialNo("PIP_PICKLING_SPL", "PICKLING_REQ_NO", prefix, 4,
                                            " WHERE PROJECT_ID=" + Session["PROJECT_ID"].ToString() + " AND SC_ID = '" + cboSubcon.SelectedValue + "'");
     }
     catch (Exception ex)
     {
         Master.show_error(ex.Message);
     }
 }
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (!WebTools.UserInRole("PIPSUPP_DELETE"))
     {
         Master.ShowWarn("Access Denied!");
         return;
     }
     if (itemsGridView.SelectedIndexes.Count == 0)
     {
         Master.ShowWarn("Select a row!");
         return;
     }
     btnYes.Visible = true;
     btnNo.Visible  = true;
     Master.ShowMessage("Proceed delete the selected row?");
 }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        var     mr_item    = string.Empty;
        var     mat_code1  = string.Empty;
        var     bal_to_ord = string.Empty;
        var     mat_id     = string.Empty;
        string  mr_id      = "";
        decimal po_item    = 0;

        Procurement_ATableAdapters.VIEW_ADAPTER_PO_DETAILTableAdapter po_detail = new Procurement_ATableAdapters.VIEW_ADAPTER_PO_DETAILTableAdapter();
        try
        {
            foreach (GridDataItem row in itemsGrid.Items)
            {
                var rcb = (RadCheckBox)row["cbColumn"].FindControl("itemCheck");
                if (Convert.ToBoolean(rcb.Checked))
                {
                    mr_id      = WebTools.GetExpr("MR_ID", "PIP_PO", " WHERE PO_ID = '" + Request.QueryString["PO_ID"] + "'");
                    mr_item    = row["MR_ITEM_NO"].Text;
                    mat_code1  = row["MAT_CODE1"].Text;
                    bal_to_ord = WebTools.GetExpr("BAL_TO_ORD", "VIEW_MR_PO_BAL", " WHERE MR_ID = '" + mr_id + "' AND MR_ITEM_NO='" + mr_item + "'");
                    //bal_to_ord = ((TextBox)row["BAL_TO_ORD"].FindControl("BAL_TO_ORDLabel")).Text;
                    mat_id = WebTools.GetExpr("MAT_ID", "PIP_MAT_STOCK", " WHERE MAT_CODE1='" + mat_code1 + "'");

                    if (string.IsNullOrEmpty(mat_id))
                    {
                        Master.ShowError("Invalid Item Code. Please Contact Administrator.");
                        return;
                    }
                    po_item = WebTools.DMax("PO_ITEM", "VIEW_PO_ITEM_MAX", " WHERE PO_ID='" + Request.QueryString["PO_ID"] + "'");
                    po_detail.InsertQuery(decimal.Parse(Request.QueryString["PO_ID"].ToString()), (po_item + 1).ToString(),
                                          decimal.Parse(mat_id), decimal.Parse(bal_to_ord), null, mr_item);
                }
            }

            Master.ShowSuccess("Selected Items Added to PO");
            itemsGrid.Rebind();
        }
        catch (Exception ex)
        {
            Master.ShowError(ex.Message);
        }
        finally
        {
            po_detail.Dispose();
        }
    }
    public void download_zip(int type_id, string ref_id, string downloadsuffix, string dir_obj, HttpResponse respone)
    {
        ZipFile zip_file = new ZipFile();

        // string irn_no = WebTools.GetExpr("MIR_NO", "PRC_MAT_INSP", " WHERE MIR_ID='" + mir_id+ "'");
        string sql           = "";
        string FileName      = "";
        string folderPath    = WebTools.GetExpr("path", "dir_objects", " DIR_OBJ='" + dir_obj + "'");
        string filePath      = string.Empty;
        string path          = WebTools.SessionDataPath();
        string zip_file_path = path + downloadsuffix + ".zip";

        using (OracleConnection conn = WebTools.GetIpmsConnection())
        {
            //Isometric
            sql = "SELECT * FROM VIEW_UPLOAD_FILES WHERE TYPE_ID=" + type_id + " AND REF_ID='" + ref_id + "'";
            using (OracleCommand cmd = new OracleCommand(sql, conn))
            {
                using (OracleDataReader dataReader = cmd.ExecuteReader())

                {
                    while (dataReader.Read())
                    {
                        FileName = WebTools.SessionDataPath() + dataReader["FILE_NAME"];

                        if (File.Exists(FileName))
                        {
                            File.Delete(FileName);
                        }

                        if (File.Exists(folderPath + dataReader["FILE_NAME"]))
                        {
                            zip_file.AddFile(folderPath + dataReader["FILE_NAME"], "files");
                        }
                    }
                } //OracleDataReader1
            }     //OracleCommand1
        }         //OracleConnection
        zip_file.Save(zip_file_path);
        var updateFile = new FileInfo(zip_file_path);

        respone.ContentType = "application/octet-stream";
        respone.AddHeader("content-disposition", "attachment;filename=\"" + Path.GetFileName(updateFile.FullName) + "\"");
        respone.AddHeader("content-length", updateFile.Length.ToString());
        respone.TransmitFile(updateFile.FullName);
        respone.Flush();
    }
    protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        try
        {
            if (e.CommandName == "Delete")
            {
                int    index       = e.Item.RowIndex;
                var    item        = RadGrid1.Items[index - 2] as Telerik.Web.UI.GridDataItem;
                var    joint_id    = item.GetDataKeyValue("JOINT_ID");
                var    repair_code = item.GetDataKeyValue("REPAIR_CODE");
                string count       = WebTools.CountExpr("JOINT_ID", "PIP_NDE_REQUEST_JOINTS", " REPAIR_CODE IS NOT NULL AND JOINT_ID=" + joint_id + " AND REPAIR_CODE='" + repair_code + "'");
                if (count.ToString() != "0")
                {
                    e.Canceled = true;
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('This Joint exists in other modules.It cannot be deleted!')", true);
                    return;
                }
                else
                {
                    e.Canceled = false;
                }
            }

            if (e.CommandName == "Edit")
            {
                int index    = e.Item.RowIndex;
                var item     = RadGrid1.Items[index - 2] as Telerik.Web.UI.GridDataItem;
                var joint_id = item.GetDataKeyValue("JOINT_ID");
                //  HiddenField1.Value = WebTools.GetExpr("WPS_NO", "PIP_SPOOL_JOINTS", " WHERE JOINT_ID=" + joint_id);
                HiddenField2.Value = WebTools.GetExpr("JOINT_SIZE_DEC", "PIP_SPOOL_JOINTS", " WHERE JOINT_ID=" + joint_id);
                HiddenField3.Value = WebTools.GetExpr("JOINT_THK", "PIP_SPOOL_JOINTS", " WHERE JOINT_ID=" + joint_id);
                string cat_id = WebTools.GetExpr("CAT_ID", "PIP_SPOOL_JOINTS", " WHERE  JOINT_ID=" + joint_id);
                if (cat_id == "1" || cat_id == "3")
                {
                    HiddenField1.Value = "1";
                }
                else
                {
                    HiddenField1.Value = "2";
                }
            }
        }
        catch (Exception exc)
        {
            Master.ShowError(exc.Message);
        }
    }
    protected void cboJoints_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
    {
        drpRepairCode.Items.Clear();
        //string rep_code;
        string sql = "select NEXT_DWR_REPAIR_CODE from view_repair_dwr_bal where joint_id=" + cboJoints.SelectedValue.ToString();

        RepairCodeDataSource.SelectCommand = sql;
        RepairCodeDataSource.DataBind();

        //rep_code = WebTools.GetExpr("NEXT_DWR_REPAIR_CODE", "VIEW_REPAIR_DWR_BAL", "JOINT_ID=" + cboJoints.SelectedValue.ToString());
        //if (rep_code == "")
        //{
        //    drpRepairCode.Items.Add(new Telerik.Web.UI.RadComboBoxItem("R1", "R1"));
        //}
        //if (rep_code == "R1")
        //{
        //    drpRepairCode.Items.Add(new Telerik.Web.UI.RadComboBoxItem("R2", "R2"));
        //}
        //if (rep_code == "R2")
        //{
        //    drpRepairCode.Items.Add(new Telerik.Web.UI.RadComboBoxItem("R3", "R3"));
        //}
        //if (rep_code == "R3")
        //{
        //    drpRepairCode.Items.Add(new Telerik.Web.UI.RadComboBoxItem("R4", "R4"));
        //}
        //if (rep_code == "R4")
        //{
        //    drpRepairCode.Items.Add(new Telerik.Web.UI.RadComboBoxItem("R5", "R5"));
        //}


        //new addition
        if (IsPostBack)
        {
            string wps_no;
            string joint_size, joint_thk;
            string joint_id = cboJoints.SelectedValue.ToString();
            wps_no     = WebTools.GetExpr("WPS_NO", "PIP_SPOOL_JOINTS", " WHERE JOINT_ID=" + joint_id);
            joint_size = WebTools.GetExpr("JOINT_SIZE_DEC", "PIP_SPOOL_JOINTS", " WHERE JOINT_ID=" + joint_id);
            joint_thk  = WebTools.GetExpr("JOINT_THK", "PIP_SPOOL_JOINTS", " WHERE JOINT_ID=" + joint_id);
            //  txtWPS_No.Text = wps_no;
            txtJoint_size.Text = joint_size;
            txtJoint_thk.Text  = joint_thk;
        }
        //end
    }
    protected void btnImport_Click(object sender, EventArgs e)
    {
        try
        {
            if (RadAsyncUpload1.UploadedFiles.Count == 0)
            {
                Master.show_error("Please Upload File to proceed.");
                return;
            }

            string proj_id = Session["PROJECT_ID"].ToString();
            string user_id = WebTools.GetExpr("USER_ID", "USERS", " WHERE USER_NAME ='" + Session["USER_NAME"] + "'");
            //string FileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
            //string Extension = Path.GetExtension(FileUpload1.PostedFile.FileName);
            string FolderPath = WebTools.SessionDataPath();
            string FileName   = Path.GetFileName(RadAsyncUpload1.UploadedFiles[0].FileName);
            string Extension  = Path.GetExtension(RadAsyncUpload1.UploadedFiles[0].FileName);
            string FilePath   = FolderPath + FileName;
            //FileUpload1.SaveAs(FilePath);
            RadAsyncUpload1.UploadedFiles[0].SaveAs(FilePath);
            // delete old data
            WebTools.ExecNonQuery("DELETE FROM PIP_PO_IMPORT WHERE PROJECT_ID = '" + Session["PROJECT_ID"].ToString() + "'");



            FileStream stream = new FileStream(FilePath, FileMode.Open, FileAccess.Read);

            DataTable dt = new DataTable();
            dt = ExcelImport.xlsxToDT2(stream);

            dt.Columns.Add("USER_ID");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["USER_ID"] = user_id;
            }

            ExcelImport.ImportDataTable(dt, "PIP_PO_IMPORT", "", "PROJECT_ID", proj_id);

            WebTools.ExecNonQuery("BEGIN PKG_BULK_IMPORT.PROC_PO_IMPORT('" + user_id + "') ; END;");

            Master.show_success("PO Data Imported Successfully.");
        }
        catch (Exception ex)
        {
            Master.show_error(ex.Message);
        }
    }
예제 #25
0
    protected void btnSendMail_Click(object sender, EventArgs e)
    {
        try
        {
            DataView  dv;
            DataTable dt;
            string    emailID;
            string    trans_no;
            string    B_STORE_ID;
            string    B_STORE;
            string    type_id              = "2";
            string    uname                = Session["USER_NAME"].ToString().ToUpper();
            string    user_id              = WebTools.GetExpr("USER_ID", "USERS", " WHERE UPPER(USER_NAME)='" + uname + "'");
            string    userEmail            = WebTools.GetExpr("EMAIL", "USERS", " WHERE UPPER(USER_NAME)='" + uname + "'");
            DataSourceSelectArguments args = new DataSourceSelectArguments();
            dv = MailDataSource.Select(args) as DataView;
            dt = dv.ToTable() as DataTable;
            string TRANSF_ID = IssueGridView.SelectedValue.ToString();
            trans_no   = WebTools.GetExpr("TRANSF_NO", "VIEW_ADAPTER_MAT_TRANSF", " WHERE TRANSF_ID='" + TRANSF_ID + "'");
            B_STORE_ID = WebTools.GetExpr("B_STORE_ID", "VIEW_ADAPTER_MAT_TRANSF", " WHERE TRANSF_ID='" + TRANSF_ID + "'");
            B_STORE    = WebTools.GetExpr("B_STORE", "VIEW_ADAPTER_MAT_TRANSF", " WHERE TRANSF_ID='" + TRANSF_ID + "'");
            string STATUS_FLG = WebTools.GetExpr("STATUS_FLG", "PIP_MAT_TRANSF", " WHERE TRANSF_ID='" + TRANSF_ID + "'");
            if (STATUS_FLG == "N")
            {
                foreach (DataRow myRow in dt.Rows)
                {
                    emailID = WebTools.GetExpr("EMAIL", "USERS_PDF_MAIL_LIST", " WHERE USER_NAME='" + myRow["USER_NAME"] + "' AND STORE_ID ='" + B_STORE_ID + "' AND UPPER(MODULE_NAME) ='MATERIAL TRANSFER'");

                    if (emailID != "")
                    {
                        string str = AmoghPdfMail.SendEmail(emailID, trans_no, uname, userEmail, type_id);
                    }
                }
                string query = "UPDATE PIP_MAT_TRANSF SET STATUS_FLG ='Y' WHERE TRANSF_ID =" + TRANSF_ID;
                WebTools.ExeSql(query);
                Master.ShowSuccess("Email Sent To : " + B_STORE + " Users");
            }
            else
            {
                Master.ShowWarn("Status Already Updated");
            }
        }
        catch (Exception ex)
        {
            Master.ShowMessage(ex.Message);
        }
    }
예제 #26
0
    protected void itemsGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        string USER_ID   = WebTools.GetExpr("CREATE_BY", "PIP_MAT_REQUISITION", " WHERE MR_ID ='" + Request.QueryString["MR_ID"] + "'");
        string CREATE_BY = WebTools.GetExpr("USER_NAME", "USERS", " WHERE USER_ID ='" + USER_ID + "'");
        string USER_NAME = Session["USER_NAME"].ToString();

        if (e.Item is GridDataItem)
        {
            GridDataItem Item = (GridDataItem)e.Item;
            if (CREATE_BY.ToUpper() != USER_NAME.ToUpper() && !WebTools.UserInRole("ADMIN"))
            {
                ImageButton btnEdit = (ImageButton)Item["EditCommandColumn"].Controls[0];
                btnEdit.Visible = false;
                ImageButton btnDelete = (ImageButton)Item["DeleteColumn"].Controls[0];
                btnDelete.Visible = false;
            }
        }
        if (e.Item.IsInEditMode && e.Item is GridEditableItem)
        {
            string query = "SELECT * FROM USER_MODULE_COLUMNS WHERE NOT  EXISTS (SELECT 1 FROM USER_MODULE_ROLES WHERE  " +
                           " SEQ =USER_MODULE_COLUMNS.SEQ   AND  USER_ID IN (SELECT USER_ID FROM USERS WHERE USER_NAME ='" + Session["USER_NAME"] + "' ))  AND HIDE_COL_NAME IS NOT NULL  AND  MODULE_ID =2 ";
            DataTable        dt       = WebTools.getDataTable(query);
            GridEditableItem dataItem = e.Item as GridEditableItem;

            foreach (DataRow row in dt.Rows)
            {
                string hide_col = row["HIDE_COL_NAME"].ToString();
                dataItem[hide_col].Enabled             = false;
                dataItem[hide_col].Controls[0].Visible = false;
            }
            string lbl_query = "SELECT * FROM USER_MODULE_COLUMNS WHERE NOT  EXISTS (SELECT 1 FROM USER_MODULE_ROLES WHERE  " +
                               " SEQ =USER_MODULE_COLUMNS.SEQ   AND  USER_ID IN (SELECT USER_ID FROM USERS WHERE USER_NAME ='" + Session["USER_NAME"] + "' ))  AND LBL_COL_NAME IS NOT NULL  AND  MODULE_ID =2";
            DataTable lbl_dt    = WebTools.getDataTable(lbl_query);
            Label[]   descLabel = new Label[30];
            int       i         = 0;
            foreach (DataRow row in lbl_dt.Rows)
            {
                string lbl_col = row["LBL_COL_NAME"].ToString();

                string str = (dataItem[lbl_col].Controls[0] as TextBox).Text;
                descLabel[i]      = new Label();
                descLabel[i].Text = str;
                dataItem[lbl_col].Controls.Add(descLabel[i]);
                i++;
            }
        }
    }
    private void Load_PDF()
    {
        string sql         = "SELECT * FROM VIEW_TEST_CARDS WHERE TC_ID=" + Session["popup_TC_ID"].ToString();
        string sg_FileName = WebTools.SessionDataPath();
        string baseUrl     = Request.Url.Scheme + "://" + Request.Url.Authority + Request.ApplicationPath.TrimEnd('/') + "/";
        string sg_pdf_html = "";
        string hc_pdf_html = "";
        string hc_url      = WebTools.GetExpr("PATH", "DIR_OBJECTS", " PROJECT_ID = '" + Session["PROJECT_ID"].ToString() + "' AND DIR_OBJ = 'MTC'");
        string hc_url1     = WebTools.GetExpr("PATH", "DIR_OBJECTS", " PROJECT_ID = '" + Session["PROJECT_ID"].ToString() + "' AND DIR_OBJ = 'MTC'");


        string hc_asp_url  = WebTools.GetExpr("ASP_PATH", "DIR_OBJECTS", " PROJECT_ID = '" + Session["PROJECT_ID"].ToString() + "' AND DIR_OBJ = 'MTC'");
        string hc_asp_url1 = WebTools.GetExpr("ASP_PATH", "DIR_OBJECTS", " PROJECT_ID = '" + Session["PROJECT_ID"].ToString() + "' AND DIR_OBJ = 'MTC'");


        using (OracleConnection conn = WebTools.GetIpmsConnection())
        {
            using (OracleCommand cmd = new OracleCommand(sql, conn))
            {
                using (OracleDataReader dataReader = cmd.ExecuteReader())
                {
                    while (dataReader.Read())
                    {
                        // HC_PDF_BLOB
                        {
                            string hc_FileName = dataReader["PDF_FILE_NAME"].ToString();
                            hc_url = hc_url1 + hc_FileName;
                            if (File.Exists(hc_url))
                            {
                                hc_asp_url   = hc_asp_url1 + hc_FileName;
                                hc_pdf_html += "<br/>";

                                hc_pdf_html += string.Format("<a href='{0}' target='_blank'>{1}</a>",
                                                             hc_asp_url,
                                                             dataReader["PDF_TITLE"]);
                            }
                        }
                    } // dataReader.Read()

                    if (hc_pdf_html.Length > 0)
                    {
                        PDF_URL_Label.Text += "<b>MTC PDF</b><br/>" + hc_pdf_html + "<br/>";
                    }
                }
            }
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        string WPS_NO = string.Empty;

        if (WPS_NO_RadAutoCompleteBox.Entries.Count > 0)
        {
            WPS_NO = WPS_NO_RadAutoCompleteBox.Entries[0].Text.ToString();
        }

        string WELD_PROCESS = string.Empty;

        if (WeldProcess_RadAutoCompleteBox.Entries.Count > 0)
        {
            WELD_PROCESS = WeldProcess_RadAutoCompleteBox.Entries[0].Text.ToString();
        }

        string date_ = txtWeldDate.SelectedDate.Value.ToString("dd-MMM-yyyy");

        VIEW_SPOOL_WELDINGTableAdapter spool_welding = new VIEW_SPOOL_WELDINGTableAdapter();

        try
        {
            spool_welding.InsertQuery(decimal.Parse(cboJoints.SelectedValue.ToString()),
                                      ddReworkCode.SelectedItem.Text,
                                      txtReportNo.Text,
                                      txtWeldDate.SelectedDate,
                                      txtInsp.Text,
                                      decimal.Parse(ddWelder.SelectedValue.ToString()),
                                      decimal.Parse(ddWelderPass.SelectedValue.ToString()),
                                      WELD_PROCESS
                                      );

            if (WPS_NO_RadAutoCompleteBox.Enabled == true && WPS_NO.Length > 0)
            {
                WebTools.ExeSql("UPDATE PIP_SPOOL_JOINTS SET WPS_NO='" + WPS_NO + "' WHERE JOINT_ID=" + cboJoints.SelectedValue.ToString());
                WPS_NO_RadAutoCompleteBox.Enabled = false;
            }

            RadGrid1.DataBind();

            NotificationBox.show_success(cboJoints.SelectedItem.Text + " Welding Saved");
        }
        catch (Exception ex)
        {
            NotificationBox.show_error(ex.Message);
        }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (To_Joints.Items.Count == 0)
        {
            Master.ShowMessage("No Joint selected!" + ViewState["0"].ToString());
            return;
        }
        VIEW_ADAPTER_NDE_JOINTSTableAdapter nde_jnts = new VIEW_ADAPTER_NDE_JOINTSTableAdapter();

        try
        {
            int cnt = 0;
            if (To_Joints.Items.Count > 0)
            {
                for (int i = 0; i < To_Joints.Items.Count; i++)
                {
                    nde_jnts.InsertQuery(decimal.Parse(Session["PROJECT_ID"].ToString()), decimal.Parse(Request.QueryString["NDE_REQ_ID"]), decimal.Parse(To_Joints.Items[i].Value), decimal.Parse(Request.QueryString["NDE_TYPE_ID"]));
                    cnt++;
                }


                To_Joints.Items.Clear();
                string nde_req = WebTools.GetExpr("NDE_REQ_NO", "PIP_NDE_REQUEST", " WHERE NDE_REQ_ID=" + Request.QueryString["NDE_REQ_ID"]);
                Master.ShowSuccess(cnt + ": Joints added to NDE Request :" + nde_req);

                From_Joints.DataBind();
                LineWiseDataSource.SelectCommand = ViewState["0"].ToString();
                LineWiseDataSource.DataBind();
                lineGrid.DataBind();

                Master.ShowSuccess(cnt + ": Joints added to NDE Request :" + nde_req);
            }
            else
            {
                Master.ShowMessage("No Joint selected!" + ViewState["0"].ToString());
                return;
            }
        }
        catch (Exception ex)
        {
            Master.ShowWarn(ex.Message);
        }
        finally
        {
            nde_jnts.Dispose();
        }
    }
예제 #30
0
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        FPConfig config = FPSystemBiz.GetCurrConfig();

        config.FP_LESSON_INTERVAL       = StringHelper.fnFormatNullOrBlankInt(tbFp_lesson_interval.Text, 1);
        config.FP_TRAIN_INTERVAL        = StringHelper.fnFormatNullOrBlankInt(tbFp_train_interval.Text, 1);
        config.FP_LESSON_ENTER_1_HH     = ddlLessonEnter1HH.SelectedIndex;
        config.FP_LESSON_ENTER_1_MM     = ddlLessonEnter1MM.SelectedIndex;
        config.FP_LESSON_ENTER_2_HH     = ddlLessonEnter2HH.SelectedIndex;
        config.FP_LESSON_ENTER_2_MM     = ddlLessonEnter2MM.SelectedIndex;
        config.FP_LESSON_ENTER_3_HH     = ddlLessonEnter3HH.SelectedIndex;
        config.FP_LESSON_ENTER_3_MM     = ddlLessonEnter3MM.SelectedIndex;
        config.FP_LESSON_ENTER_4_HH     = ddlLessonEnter4HH.SelectedIndex;
        config.FP_LESSON_ENTER_4_MM     = ddlLessonEnter4MM.SelectedIndex;
        config.FP_TRAIN_1_ENTER_FROM_HH = ddlTrain1EnterFromHH.SelectedIndex;
        config.FP_TRAIN_1_ENTER_FROM_MM = ddlTrain1EnterFromMM.SelectedIndex;
        config.FP_TRAIN_1_ENTER_TO_HH   = ddlTrain1EnterToHH.SelectedIndex;
        config.FP_TRAIN_1_ENTER_TO_MM   = ddlTrain1EnterToMM.SelectedIndex;

        config.FP_TRAIN_2_ENTER_FROM_HH = ddlTrain2EnterFromHH.SelectedIndex;
        config.FP_TRAIN_2_ENTER_FROM_MM = ddlTrain2EnterFromMM.SelectedIndex;
        config.FP_TRAIN_2_ENTER_TO_HH   = ddlTrain2EnterToHH.SelectedIndex;
        config.FP_TRAIN_2_ENTER_TO_MM   = ddlTrain2EnterToMM.SelectedIndex;

        config.FP_TRAIN_3_ENTER_FROM_HH = ddlTrain3EnterFromHH.SelectedIndex;
        config.FP_TRAIN_3_ENTER_FROM_MM = ddlTrain3EnterFromMM.SelectedIndex;
        config.FP_TRAIN_3_ENTER_TO_HH   = ddlTrain3EnterToHH.SelectedIndex;
        config.FP_TRAIN_3_ENTER_TO_MM   = ddlTrain3EnterToMM.SelectedIndex;

        config.FP_TRAIN_1_LEAVE_HH = ddlTrain1LeaveHH.SelectedIndex;
        config.FP_TRAIN_1_LEAVE_MM = ddlTrain1LeaveMM.SelectedIndex;
        config.FP_TRAIN_2_LEAVE_HH = ddlTrain2LeaveHH.SelectedIndex;
        config.FP_TRAIN_2_LEAVE_MM = ddlTrain2LeaveMM.SelectedIndex;
        config.FP_TRAIN_3_LEAVE_HH = ddlTrain3LeaveHH.SelectedIndex;
        config.FP_TRAIN_3_LEAVE_MM = ddlTrain3LeaveMM.SelectedIndex;


        if (SimpleOrmOperator.Update(config))
        {
            WebTools.Alert("配置修改成功");
        }
        else
        {
            WebTools.Alert("配置修改失败");
        }
        FPSystemBiz.CacheFpConfig = null;
    }
예제 #31
0
파일: App.xaml.cs 프로젝트: Tinytoot/G2PO
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Enable URI Mapper
            RootFrame.UriMapper = Resources["UriMapper"] as UriMapper;

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = false;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

            // Initialize application wide settings and DataBase utilities.
            using (LocalDatabaseDataContext db = new LocalDatabaseDataContext(DBLocation))
            {
                //Inorder to clean the db uncomment the next line (or, if debugging, rebuild solution)
                //db.DeleteDatabase();
                if (!db.DatabaseExists())
                {
                    db.CreateDatabase();
                }
                db.SubmitChanges();
            }

            // Needs to be called AFTER DatabaseContext is Disposed above.
            DataBaseUtility = new DataUtils(DBLocation);

            Favorites = new Category { CategoryTitle = "Favorites" };
            App.DataBaseUtility.AddCategory(Favorites);
            App.DataBaseUtility.SaveChangesToDB();

            ApplicationSettings = new Settings();

            // WebTools object used for initial download and refreshing.
            SynFeedDownloader = new WebTools(new SynFeedParser());

            // ArticleSource array used to keep track of article page source.
            ArticleSource = new string[2];

            // Create the background agent if it does not already exist on the scheduler.
            BackgroundAgentTools BGTools = new BackgroundAgentTools();
            BGTools.StartPeriodicAgent();

            // Redirect initial navigation.
            RootFrame.Navigating += new NavigatingCancelEventHandler(RootFrame_Navigating);
        }
예제 #32
0
 private void systemToolStripMenuItem_Click(object sender, EventArgs e)
 {
     WebTools webTools = new WebTools();
     webTools.Show();
 }
예제 #33
0
        /// <summary>
        /// Agent that runs a scheduled task
        /// </summary>
        /// <param name="task">
        /// The invoked task
        /// </param>
        /// <remarks>
        /// This method is called when a periodic or resource intensive task is invoked
        /// </remarks>
        protected override void OnInvoke(ScheduledTask task)
        {
            // Run the periodic task.
            List<Feed> allFeeds = DataBaseTools.GetAllFeeds();
            _remainingDownloads = allFeeds.Count;
            if (_remainingDownloads > 0)
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                    {
                        WebTools downloader = new WebTools(new SynFeedParser());
                        downloader.SingleDownloadFinished += SendToDatabase;
                        try
                        {
                            downloader.Download(allFeeds);
                        }
                        //TODO handle errors.
                        catch { }
                    });
            }

            // Used to quickly invoke task when debugging.
            //#if DEBUG_AGENT
            //            ScheduledActionService.LaunchForTest(task.Name, System.TimeSpan.FromSeconds(600));
            //#endif
        }