示例#1
0
        private void BtnOK_Click(object sender, EventArgs e)
        {
            DataTable dt = dtgCode.DataSource as DataTable;

            if (bAdmin)
            {
                this.ReturnCodeValue     = "testadmin";
                this.ReturnNameValue     = "관리자";
                this.ReturnCodeNameValue = ReturnCodeValue + " : " + ReturnNameValue;
                this.Close();
                return;
            }

            if (CommonFuction.IsNullOrWhiteSpace(dtgCode.CurrentRow))
            {
                MessageBox.Show("선택된 항목이 없습니다.");
                return;
            }

            DataGridViewRow gRow = dtgCode.CurrentRow;

            this.ReturnCodeValue     = gRow.Cells["code"].Value.ToString();
            this.ReturnNameValue     = gRow.Cells["name"].Value.ToString();
            this.ReturnCodeNameValue = ReturnCodeValue + " : " + ReturnNameValue;
            this.Close();
        }
示例#2
0
        /// <summary>
        /// * 함 수 명 : TxtText_KeyPress
        /// * 작 성 자 : 황지희
        /// * 개 요 : key 이벤트 영어(대문자), 숫자만 입력받도록 valid 체크
        /// </summary>
        private void TxtText_KeyPress(object sender, KeyPressEventArgs e)
        {
            TextBox     txt  = (TextBox)sender;
            Control     temp = txt.Parent;
            MaskTextBox mtb  = null;

            while (temp.Parent != null)
            {
                if (temp is MaskTextBox)
                {
                    mtb = temp as MaskTextBox;
                    break;
                }
                temp = temp.Parent;
            }
            if (mtb == null)
            {
                return;
            }

            switch (mtb.Name)
            {
            case "txt_MaskNum":
            case "txt_EqpId":
                CommonFuction.TypingOnlyEngNum(sender, e, mtb);
                break;
            }
        }
示例#3
0
        private void InitGridView(string type)
        {
            string CodeColumn = "";
            string NameColumn = "";

            switch (type)
            {
            case "VENDER":
                CodeColumn = "venderid";
                NameColumn = "vendername";
                break;

            case "EQUIP":
                CodeColumn = "equipmentid";
                NameColumn = "equipmentname";
                break;

            case "USER":
            case "LOGIN":
                CodeColumn = "userid";
                NameColumn = "username";
                break;

            default:
                break;
            }
            dtgCode.AutoGenerateColumns = false;
            CommonFuction.SetDataGridViewColumnStyle(dtgCode, "코드", CodeColumn, "code", typeof(string), 130);
            CommonFuction.SetDataGridViewColumnStyle(dtgCode, "이름", NameColumn, "name", typeof(string), 250);
        }
示例#4
0
        /// <summary>
        /// 입력 컨트롤 전체 초기화
        /// </summary>
        private void ClearInputBox()
        {
            try
            {
                SetEnabled(true);
                SetReadOnly(false);

                mtxtID.txtText.Text = CommonFuction.DurableIdCreator();
                mtxtName.txtText.ResetText();
                mtxtCode.txtText.ResetText();

                mtxtVenderName.txtText.ResetText();
                mtxtVenderCode.txtText.ResetText();

                mtxtCreator.ucValue = Program.CurrentUserName;
                mtxtDesc.txtText.ResetText();

                mcbmbInputResult.cboCombo.SelectedIndex = -1;
                mcbmRack.cboCombo.SelectedIndex         = -1;
                mcmbModelCode.cboCombo.SelectedIndex    = -1;


                txtCreateDate.ResetText();

                GetProductInfo = false;
            }

            catch (Exception ee)
            {
                LogFactory.Log(ee);
            }
        }
        private void GetData()
        {
            string connStr = CommonFuction.GetAppSetting("DBConnectionString");
            Dictionary <string, string> connDic = new Dictionary <string, string>();
            List <string> arrConnStr            = new List <string>();

            arrConnStr.AddRange(connStr.Split(';'));

            foreach (string x in arrConnStr)
            {
                string[] temp = x.Trim().Split('=');
                connDic.Add(temp[0], temp[1]);
            }

            string value = "";

            if (connDic.TryGetValue("Data Source", out value))
            {
                mtxtIP.ucValue = value;
            }
            if (connDic.TryGetValue("initial Catalog", out value))
            {
                mtxtCatalog.ucValue = value;
            }
            if (connDic.TryGetValue("user", out value))
            {
                mtxtID.ucValue = value;
            }
            if (connDic.TryGetValue("password", out value))
            {
                mtxtPW.ucValue = value;
            }
        }
示例#6
0
 /// <summary>
 /// * 함 수 명 : TxtWidth_KeyPress
 /// * 개 요 : 숫자만 입력 가능 / 엔터 포커싱
 /// </summary>
 ///
 private void TxtWidth_KeyPress(object sender, KeyPressEventArgs e)
 {
     CommonFuction.TypingOnlyNumber(sender, e, false);
     if (e.KeyChar == (char)Keys.Enter)
     {
         txtHeight.Focus();
     }
 }
示例#7
0
        /// <summary>
        /// * 함 수 명 : MtxtUserID_KeyPress
        /// * 개 요 : mtxtUserID -> 영문대문자, 숫자만 입력가능
        /// </summary>

        private void MtxtUserID_KeyPress(object sender, KeyPressEventArgs e)
        {
            CommonFuction.TypingOnlyEngNum(sender, e, mtxtUserID);

            if (e.KeyChar == (char)Keys.Enter)
            {
                mtxtUserName.Focus();
            }
        }
        /// <summary>
        ///  작성자 : 강선애
        ///  단축 키 지정 이벤트를 위한 함수 추가
        /// </summary>
        private void Btn_Save_Click()
        {
            //필수 입력값 확인
            string ctrlname = "";

            if (!CommonFuction.CheckMandatory(panel1, ref ctrlname))
            {
                CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", ctrlname + "을 확인해주세요.");
                return;
            }

            string sValidReslt = Valid();

            if (sValidReslt.Equals("SAVE_FALSE"))
            {
                return;
            }

            if (CustomMessageBox.Show(MessageBoxButtons.OKCancel, "저장", "저장 하시겠습니까?") == DialogResult.OK)
            {
                Dictionary <string, object> Params = new Dictionary <string, object>();
                Params.Add("@durableid", this.txt_MaskNum.ucValue);       //Mask 일련번호
                Params.Add("@durableproductid", this.txt_ProdId.ucValue); //모델명
                Params.Add("@useqty", this.txt_NowUse.ucValue);           //사용 횟수
                Params.Add("@totuseqty", iNewTotUseQty);                  //사용 횟수
                Params.Add("@comment", this.txt_Comment.ucValue);         //사양 정보
                Params.Add("@modifier", Program.CurrentUser);             //사용자
                Params.Add("@workstate", "WORKSTATE_USED");               //WOKR STATE
                //Params.Add("@usedate",DateTime.Now);    //WOKR STATE
                //rams.Add("@state", "STATE_ACTIVE");    //LOT STATE

                if (sValidReslt.Equals("SAVE_TERMINATED"))
                {
                    Params.Add("@lotstate", "STATE_TERMINATED"); //LOT STATE
                    //2019-05-14 황지희 폐기일 경우 RACKID 빈값 파람 추가
                    Params.Add("@rackid", "");                   //RACK ID
                }
                else
                {
                    Params.Add("@lotstate", "STATE_ACTIVE");
                    Params.Add("@rackid", this.txt_Rack.ucValue);
                }

                var PamasArr = DB.GetSqlParameters(Params);

                int SaveResult = DB.CallNonSelectProcedure("SaveMaskInfo", PamasArr);

                if (SaveResult > 0)
                {
                    CustomMessageBox.Show(MessageBoxButtons.OK, "SAVE", "저장하였습니다.");
                    //2019-05-08 황지희 저장후 MASK 일련번호로 포커스 추가
                    txt_MaskNum.Focus();
                    InitReset();
                    resetRack.ResetRackStatus(true);
                }
            }
        }
示例#9
0
        private void MMInspectPop_Load(object sender, EventArgs e)
        {
            //db connect
            DB.Open();

            //SetComboBox();
            CommonFuction.SetInputResultList(ref cmb_InspResult); //세척 검사 결과
            this.cmb_InspResult.ucComboIndex = -1;

            //2019-05-15 황지희 설비 코드로 focus 되도록 변경
            ActiveControl = txt_EqpId;
        }
示例#10
0
        /// <summary>
        /// 실제 Rack을 나타내는 컨트롤을 위치에 맞게 세팅해줌
        /// </summary>
        public void DrawRacks()
        {
            if (MainDataSet != null)
            {
                //RackList = MainDataSet.Tables[1];
            }

            tlpRack.Hide();
            try
            {
                tlpRack.Controls.Clear();

                foreach (DataRow x in RackList.Rows)
                {
                    UserControls.RackControl NewCtrl = new UserControls.RackControl();
                    NewCtrl.RackControlClick += NewCtrl_Click;
                    NewCtrl.ChangeRackName(x["EQUIPMENTID"] as string);
                    NewCtrl.Dock = DockStyle.Fill;
                    if (CommonFuction.IsNullOrWhiteSpace(x["DURABLEPRODUCTNAME"]))
                    {
                        x["DURABLEPRODUCTNAME"] = "";
                    }
                    NewCtrl.ChangeMaskName((string)x["DURABLEPRODUCTNAME"]);
                    tlpRack.Controls.Add(NewCtrl, (int)x["LOCATIONX"] - 1, (int)x["LOCATIONY"] - 1);

                    if (CommonFuction.IsNullOrWhiteSpace(x["DURABLEID"]))
                    {
                        NewCtrl.ChangeRackState("empty");
                    }
                    else if ((int)x["WARNINGUSEQTY"] <= (int)x["TOTUSEQTY"])
                    {
                        NewCtrl.ChangeRackState("warning");
                    }
                    else
                    {
                        if ((string)x["WORKSTATE"] == "WORKSTATE_USED" || (string)x["WORKSTATE"] == "WORKSTATE_USING")
                        {
                            NewCtrl.ChangeRackState("using");
                        }
                        else
                        {
                            NewCtrl.ChangeRackState("stock");
                        }
                    }
                }
            }
            catch (Exception e)
            {
                LogFactory.Log(e);
            }

            tlpRack.Show();
        }
        /// <summary>
        /// 그리드 세팅
        /// </summary>
        private void InitializeGrid()
        {
            // 대분류
            grdTopCategory.AutoGenerateColumns                     = false;
            grdTopCategory.ColumnHeadersHeightSizeMode             = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
            grdTopCategory.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
            grdTopCategory.AllowUserToAddRows = false;
            grdTopCategory.SelectionMode      = DataGridViewSelectionMode.FullRowSelect;
            grdTopCategory.DefaultCellStyle.SelectionBackColor = Color.Yellow;
            grdTopCategory.DefaultCellStyle.SelectionForeColor = Color.Black;

            CommonFuction.SetDataGridViewColumnStyle(grdTopCategory, "NO", "NO", "NO", typeof(string), 50, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdTopCategory, "불량코드", "DEFECTCODE", "DEFECTCODE", typeof(string), 120, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdTopCategory, "불량명", "DEFECTCODENAME", "DEFECTCODENAME", typeof(string), 180, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdTopCategory, "유효여부", "VALIDSTATE", "VALIDSTATE", typeof(string), 100, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdTopCategory, "상위불량코드", "PARENTDEFECTCODE", "PARENTDEFECTCODE", typeof(string), 100, true, false, DataGridViewContentAlignment.MiddleLeft, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdTopCategory, "레벨", "LEVEL", "LEVEL", typeof(string), 100, true, false, DataGridViewContentAlignment.MiddleLeft, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdTopCategory, "행변경타입", "ROWTYPE", "ROWTYPE", typeof(string), 100, true, false, DataGridViewContentAlignment.MiddleLeft, 10);

            // 중분류
            grdMiddleCategory.AutoGenerateColumns                     = false;
            grdMiddleCategory.ColumnHeadersHeightSizeMode             = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
            grdMiddleCategory.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
            grdMiddleCategory.AllowUserToAddRows = false;
            grdMiddleCategory.SelectionMode      = DataGridViewSelectionMode.FullRowSelect;
            grdMiddleCategory.DefaultCellStyle.SelectionBackColor = Color.Yellow;
            grdMiddleCategory.DefaultCellStyle.SelectionForeColor = Color.Black;

            CommonFuction.SetDataGridViewColumnStyle(grdMiddleCategory, "NO", "NO", "NO", typeof(string), 50, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdMiddleCategory, "불량코드", "DEFECTCODE", "DEFECTCODE", typeof(string), 120, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdMiddleCategory, "불량명", "DEFECTCODENAME", "DEFECTCODENAME", typeof(string), 180, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdMiddleCategory, "유효여부", "VALIDSTATE", "VALIDSTATE", typeof(string), 100, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdMiddleCategory, "상위불량코드", "PARENTDEFECTCODE", "PARENTDEFECTCODE", typeof(string), 100, true, false, DataGridViewContentAlignment.MiddleLeft, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdMiddleCategory, "레벨", "LEVEL", "LEVEL", typeof(string), 100, true, false, DataGridViewContentAlignment.MiddleLeft, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdMiddleCategory, "행변경타입", "ROWTYPE", "ROWTYPE", typeof(string), 100, true, false, DataGridViewContentAlignment.MiddleLeft, 10);

            // 불량상세
            grdDetailCategory.AutoGenerateColumns                     = false;
            grdDetailCategory.ColumnHeadersHeightSizeMode             = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
            grdDetailCategory.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
            grdDetailCategory.AllowUserToAddRows = false;
            grdDetailCategory.SelectionMode      = DataGridViewSelectionMode.FullRowSelect;
            grdDetailCategory.DefaultCellStyle.SelectionBackColor = Color.Yellow;
            grdDetailCategory.DefaultCellStyle.SelectionForeColor = Color.Black;

            CommonFuction.SetDataGridViewColumnStyle(grdDetailCategory, "NO", "NO", "NO", typeof(string), 50, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdDetailCategory, "불량코드", "DEFECTCODE", "DEFECTCODE", typeof(string), 120, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdDetailCategory, "불량명", "DEFECTCODENAME", "DEFECTCODENAME", typeof(string), 180, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdDetailCategory, "유효여부", "VALIDSTATE", "VALIDSTATE", typeof(string), 100, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdDetailCategory, "상위불량코드", "PARENTDEFECTCODE", "PARENTDEFECTCODE", typeof(string), 100, true, false, DataGridViewContentAlignment.MiddleLeft, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdDetailCategory, "레벨", "LEVEL", "LEVEL", typeof(string), 100, true, false, DataGridViewContentAlignment.MiddleLeft, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdDetailCategory, "행변경타입", "ROWTYPE", "ROWTYPE", typeof(string), 100, true, false, DataGridViewContentAlignment.MiddleLeft, 10);
        }
示例#12
0
        /// <summary>
        /// 단축키 입력 및 버튼 입력시 실행되는 코드
        /// </summary>
        public void Btn_Ok_Click()
        {
            string ctrlname = "";

            if (!CommonFuction.CheckMandatory(gbScrap, ref ctrlname))
            {
                CustomMessageBox.Show(MessageBoxButtons.OK, "확인", ctrlname + "을 확인해주세요");
                return;
            }
            else
            {
                if (string.IsNullOrWhiteSpace(txtNumber.ucValue) == false && string.IsNullOrWhiteSpace(txtRackId.ucValue) == true)
                {
                    result = CustomMessageBox.Show(MessageBoxButtons.OK, "확인", "해당 모델은 이미 폐기되었습니다.");
                }
                else
                {
                    try
                    {
                        sql    = "ProcDurable&HistInMMScrapPop";
                        result = CustomMessageBox.Show(MessageBoxButtons.OKCancel, "확인", "폐기하시겠습니까?");
                        if (result == DialogResult.OK)
                        {
                            Dictionary <string, object> param = new Dictionary <string, object>();
                            param.Add("@id", txtNumber.ucValue);
                            param.Add("@modifier", Program.CurrentUser);
                            param.Add("@comment", txtComment.ucValue);
                            DataTable table = db.ExecuteProcedure(sql, param);
                            result = CustomMessageBox.Show(MessageBoxButtons.OK, "확인", "폐기되었습니다.");

                            resetRack.ResetRackStatus(true);
                            foreach (Control ctrl in gbScrap.Controls)
                            {
                                if (ctrl is UserControls.MaskTextBox)
                                {
                                    UserControls.MaskTextBox tb = (UserControls.MaskTextBox)ctrl;
                                    if (string.IsNullOrWhiteSpace(tb.ucValue) == false)
                                    {
                                        tb.ucValue = string.Empty;
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ee)
                    {
                        LogFactory.Log(ee);
                        CustomMessageBox.Show(MessageBoxButtons.OK, "확인", "문제가 발생했습니다.\n 로그를 확인하세요.");
                    }
                }
            }
        }
示例#13
0
        /// <summary>
        /// 그리드 세팅
        /// </summary>
        private void InitializeGrid()
        {
            grdUser.AutoGenerateColumns                     = false;
            grdUser.ColumnHeadersHeightSizeMode             = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
            grdUser.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
            grdUser.AllowUserToAddRows = false;

            CommonFuction.SetDataGridViewColumnStyle(grdUser, "NO", "NO", "NO", typeof(string), 50, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdUser, "순번", "SEQUENCE", "SEQUENCE", typeof(int), 100, false, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdUser, "사번", "USERNUMBER", "USERNUMBER", typeof(string), 200, false, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdUser, "사용자명", "USERNAME", "USERNAME", typeof(string), 200, false, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdUser, "행변경타입", "ROWTYPE", "ROWTYPE", typeof(string), 100, false, false, DataGridViewContentAlignment.MiddleLeft, 10);
        }
示例#14
0
        private void BtnSave_Click()
        {
            try
            {
                sql = "ProcVenderInVenderTab";
                string ctrlname = "";
                int    iRow     = -1;
                if (!CommonFuction.CheckMandatory(groupBox1, ref ctrlname))
                {
                    CustomMessageBox.Show(MessageBoxButtons.OK, "확인", ctrlname + "을 확인해주세요");
                    return;
                }
                if (state == false)
                {
                    result = CustomMessageBox.Show(MessageBoxButtons.OKCancel, "확인", "저장하시겠습니까?");
                    if (result == DialogResult.OK)
                    {
                        table = db.ExecuteProcedure(sql, AddParam());
                        TableRefresh();
                        GridRowChange(iRow);
                        MakeEmpty();
                    }
                }
                else
                {
                    iRow = dtgVenderList.CurrentRow.Index;

                    ctrlname = "";
                    if (!CommonFuction.CheckMandatory(groupBox1, ref ctrlname))
                    {
                        CustomMessageBox.Show(MessageBoxButtons.OK, "확인", ctrlname + "을 확인해주세요");
                        return;
                    }
                    result = CustomMessageBox.Show(MessageBoxButtons.OKCancel, "확인", "저장하시겠습니까?");
                    if (result == DialogResult.OK)
                    {
                        table = db.ExecuteProcedure(sql, AddParam());
                        TableRefresh();
                        GridRowChange(iRow);
                        MakeEmpty();
                    }
                }
            }
            catch (Exception ee)
            {
                LogFactory.Log(ee);
                CustomMessageBox.Show(MessageBoxButtons.OK, "확인", "문제가 발생했습니다.\n 로그를 확인하세요.");
            }
        }
示例#15
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     SetEvent();
     System.Configuration.AppSettingsReader temp = new System.Configuration.AppSettingsReader();
     lblCrrUser.Text = CommonFuction.GetUserName(Program.CurrentUser);
     if (string.IsNullOrEmpty(Program.CurrentUser))
     {
         BtnLogIn_Click(null, null);
     }
     //MMManagedReportControl = new MMManagedReportControl();
     // MMManagedReportTabPage.Controls.Add(mMManagedReportControl);
     ResetRackStatus(true);
     this.txt_MaskNum.txtText.CharacterCasing = CharacterCasing.Upper;
 }
示例#16
0
 /// <summary>
 /// 버튼의 이벤트들이 발생된 후 각각의 컨트롤러의 텍스트들을 초기화 해주는 함수
 /// </summary>
 public void MakeEmpty()
 {
     CommonFuction.SetUseYNList(ref cbbUseYN);
     foreach (Control ctrl in groupBox1.Controls)
     {
         if (ctrl is UserControls.MaskTextBox)
         {
             UserControls.MaskTextBox tb = (UserControls.MaskTextBox)ctrl;
             if (tb.ucValue != string.Empty)
             {
                 tb.ucValue = string.Empty;
             }
         }
     }
 }
示例#17
0
        /// <summary>
        /// 그리드 세팅
        /// </summary>
        private void InitializeGrid()
        {
            grdFrameInfo.AutoGenerateColumns                     = false;
            grdFrameInfo.ColumnHeadersHeightSizeMode             = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
            grdFrameInfo.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
            grdFrameInfo.AllowUserToAddRows = false;

            CommonFuction.SetDataGridViewColumnStyle(grdFrameInfo, "NO", "NO", "NO", typeof(string), 50, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdFrameInfo, "시간", "PRODUCTTYPE", "rackid", typeof(string), 200, false, true, DataGridViewContentAlignment.MiddleCenter, 20);
            CommonFuction.SetDataGridViewColumnStyle(grdFrameInfo, "프레임", "PRODUCTNAME", "durableid", typeof(int), 100, false, true, DataGridViewContentAlignment.MiddleCenter, 20);
            CommonFuction.SetDataGridViewColumnStyle(grdFrameInfo, "자동판정등급", "PRODUCTNO", "productname", typeof(string), 100, false, true, DataGridViewContentAlignment.MiddleCenter, 80);
            CommonFuction.SetDataGridViewColumnStyle(grdFrameInfo, "불량유형", "CUSTOMERNAME", "inputdate", typeof(string), 100, false, true, DataGridViewContentAlignment.MiddleCenter, 60);
            CommonFuction.SetDataGridViewColumnStyle(grdFrameInfo, "최종판정", "CREATOR", "inputresult", typeof(string), 100, false, true, DataGridViewContentAlignment.MiddleCenter, 35);
            CommonFuction.SetDataGridViewColumnStyle(grdFrameInfo, "위치", "CREATETIME", "usedate", typeof(string), 500, false, true, DataGridViewContentAlignment.MiddleLeft, 60);
            CommonFuction.SetDataGridViewColumnStyle(grdFrameInfo, "행변경타입", "ROWTYPE", "ROWTYPE", typeof(string), 100, false, false, DataGridViewContentAlignment.MiddleLeft, 60);
        }
示例#18
0
        private void Btn_Add_Click()
        {
            string ctrlname = "";

            if (CommonFuction.CheckMandatory(MaskCleanPanel, ref ctrlname))
            {
                if (CustomMessageBox.Show(MessageBoxButtons.OKCancel, "신규", "신규 생성 하시겠습니까?") == DialogResult.OK)
                {
                    InitReset();
                }
            }
            else
            {
                InitReset();
            }
        }
示例#19
0
        public string SetMaskDatas(string RackId)
        {
            DataSet ds = new DataSet();

            ds = conn.CallSelectProcedure_ds(ProcedureName, new SqlParameter[] { new SqlParameter("rackid", RackId) });

            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataRow dr = ds.Tables[0].Rows[0];
                lblDataMaskID.Text    = dr["durableid"].ToString();
                lblDataModelCode.Text = dr["durableproductid"].ToString();
                lblDataModelName.Text = dr["durableproductname"].ToString();
                lblDataRackID.Text    = dr["equipmentid"].ToString();
                lblDataInputInsp.Text = dr["inputresult"].ToString();
                if (!CommonFuction.IsNullOrWhiteSpace(dr["inputdate"]))
                {
                    lblDataInputDate.Text = dr["inputdate"].ToString();
                }
                else
                {
                    lblDataInputDate.Text = "";
                }
                if (!CommonFuction.IsNullOrWhiteSpace(dr["usedate"]))
                {
                    lblDataRecentUse.Text = dr["usedate"].ToString();
                }
                else
                {
                    lblDataRecentUse.Text = "";
                }
                if ((int)dr["totuseqty"] > 0)
                {
                    lblDataTotalUse.Text = dr["totuseqty"].ToString();
                }
                else
                {
                    lblDataTotalUse.Text = "";
                }
                lblDataCleanInsp.Text   = dr["cleanresult"].ToString();
                lblDataDescription.Text = dr["description"].ToString();
            }

            return(ds.Tables.Count.ToString());
        }
        private void InitGridView()
        {
            dataGridView1.AutoGenerateColumns = false;
            dataGridView2.AutoGenerateColumns = false;

            dataGridView1.ColumnHeadersHeightSizeMode             = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
            dataGridView1.ColumnHeadersHeight                     = dataGridView1.ColumnHeadersHeight * 2;
            dataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;

            dataGridView1.Paint              += DataGridView1_Paint;
            dataGridView1.CellPainting       += DataGridView1_CellPainting;
            dataGridView1.ColumnWidthChanged += DataGridView1_ColumnWidthChanged;
            dataGridView1.Scroll             += DataGridView1_Scroll;

            btnExcel.Click  += BtnExcel_Click;
            btnPrint.Click  += BtnPrint_Click;
            btnSearch.Click += BtnSearch_Click;
            //컬럼명 setting
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "No", "No", "No", typeof(string), 50, true, true, DataGridViewContentAlignment.MiddleLeft, 10);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "보관위치", "rackid", "rackid", typeof(string), 70, true, true, DataGridViewContentAlignment.MiddleCenter, 20);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "Mask No", "durableid", "durableid", typeof(string), 100, true, true, DataGridViewContentAlignment.MiddleCenter, 20);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "Mask Code", "productname", "productname", typeof(string), 150, true, true, DataGridViewContentAlignment.MiddleLeft, 80);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "입고일자", "inputdate", "inputdate", typeof(string), 150, true, true, DataGridViewContentAlignment.MiddleLeft, 60);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "수입검사 결과", "inputresult", "inputresult", typeof(string), 100, true, true, DataGridViewContentAlignment.MiddleCenter, 35);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "사용일자", "usedate", "usedate", typeof(string), 150, true, true, DataGridViewContentAlignment.MiddleLeft, 60);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "횟수", "totuseqty", "totuseqty", typeof(string), 100, true, true, DataGridViewContentAlignment.MiddleRight, 35);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "폐기일", "defectdate", "defectdate", typeof(string), 150, true, true, DataGridViewContentAlignment.MiddleLeft, 60);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "사유", "defectreason", "defectreason", typeof(string), 100, true, true, DataGridViewContentAlignment.MiddleLeft, 100);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "durableproductid", "durableproductid", "durableproductid", typeof(string), -1, false, false);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView1, "state", "state", "state", typeof(string), -1, false, false);

            //헤더 병합 안된 컬럼들 가운데 정렬하기
            dataGridView1.Columns["No"].HeaderCell.Style.Alignment          = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns["rackid"].HeaderCell.Style.Alignment      = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns["durableid"].HeaderCell.Style.Alignment   = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns["productname"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns["inputdate"].HeaderCell.Style.Alignment   = DataGridViewContentAlignment.MiddleCenter;
            dataGridView1.Columns["inputresult"].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;


            CommonFuction.SetDataGridViewColumnStyle(dataGridView2, "날짜", "usedate", "usedate", typeof(DateTime), 130, true, true, DataGridViewContentAlignment.MiddleCenter);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView2, "횟수", "useqty", "useqty", typeof(string), 50, true, true, DataGridViewContentAlignment.MiddleRight);
            CommonFuction.SetDataGridViewColumnStyle(dataGridView2, "durableid", "durableid", "durableid", typeof(string), -1, false, false);
        }
示例#21
0
        /// <summary>
        /// Table Layout View 초기화
        /// Rack의 배치 레이아웃에 맞춰 세팅해줌.
        /// </summary>
        public void Initialization()
        {
            try
            {
                if (MainDataSet != null)
                {
                    RackDesign = MainDataSet.Tables[0];
                    if (Program.MaxX.Equals(0) && !CommonFuction.IsNullOrWhiteSpace(RackDesign.Rows[0]["MAX_X"]))
                    {
                        Program.MaxX = (int)RackDesign.Rows[0]["MAX_X"];
                    }
                    if (Program.MaxY.Equals(0) && !CommonFuction.IsNullOrWhiteSpace(RackDesign.Rows[0]["MAX_Y"]))
                    {
                        Program.MaxY = (int)RackDesign.Rows[0]["MAX_Y"];
                    }
                }

                tlpRack.Hide();

                tlpRack.ColumnCount = Program.MaxX + 1;
                tlpRack.RowCount    = Program.MaxY + 1;

                tlpRack.ColumnStyles.Clear();
                tlpRack.RowStyles.Clear();

                for (var i = 0; i < tlpRack.ColumnCount; i++)
                {
                    tlpRack.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, this.Size.Width / Program.MaxX));
                }

                for (var i = 0; i < tlpRack.RowCount; i++)
                {
                    tlpRack.RowStyles.Add(new RowStyle(SizeType.Absolute, this.Size.Height / Program.MaxY));
                }
                tlpRack.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 1));
                tlpRack.RowStyles.Add(new RowStyle(SizeType.Absolute, 1));

                tlpRack.Show();
            }
            catch (Exception ee)
            {
                LogFactory.Log(ee);
            }
        }
        /// <summary>
        /// 그리드 세팅
        /// </summary>
        private void InitializeGrid()
        {
            grdAIjubgmentHistory.AutoGenerateColumns                     = false;
            grdAIjubgmentHistory.ColumnHeadersHeightSizeMode             = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
            grdAIjubgmentHistory.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter;
            grdAIjubgmentHistory.AllowUserToAddRows = false;

            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "NO", "NO", "NO", typeof(string), 50, true, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "품목ID", "PRODUCTID", "PRODUCTID", typeof(string), 150, false, true, DataGridViewContentAlignment.MiddleCenter, 10);
            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "고객", "PRODUCTTYPE", "rackid", typeof(string), 150, false, true, DataGridViewContentAlignment.MiddleCenter, 20);
            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "도번", "PRODUCTNAME", "durableid", typeof(int), 180, false, true, DataGridViewContentAlignment.MiddleCenter, 20);
            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "품번", "PRODUCTNO", "productname", typeof(string), 180, false, true, DataGridViewContentAlignment.MiddleCenter, 80);
            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "LOT번호", "CUSTOMERNAME", "inputdate", typeof(string), 250, false, true, DataGridViewContentAlignment.MiddleCenter, 60);
            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "검사일자", "CREATOR", "inputresult", typeof(string), 200, false, true, DataGridViewContentAlignment.MiddleCenter, 35);
            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "최종판정", "CREATETIME", "usedate", typeof(string), 100, false, true, DataGridViewContentAlignment.MiddleLeft, 60);
            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "AI판정", "MODIFIER", "usedate", typeof(string), 100, false, true, DataGridViewContentAlignment.MiddleLeft, 60);
            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "불량유형", "MODIFIEDTIME", "usedate", typeof(string), 100, false, true, DataGridViewContentAlignment.MiddleLeft, 60);
            CommonFuction.SetDataGridViewColumnStyle(grdAIjubgmentHistory, "행변경타입", "ROWTYPE", "ROWTYPE", typeof(string), 100, false, false, DataGridViewContentAlignment.MiddleLeft, 60);
        }
示例#23
0
        private void VenderTabPageControl_Load(object sender, EventArgs e)
        {
            this.ActiveControl = txtVenderID;
            CommonFuction.SetUseYNList(ref cbbUseYN);

            try
            {
                sql = "SelectVender";
                db.Open();
                Dictionary <string, object> param = new Dictionary <string, object>();
                dtgVenderList.DataSource = db.ExecuteProcedure(sql, param);
                DataGridViewProperties();
            }
            catch (Exception ex)
            {
                LogFactory.Log(ex);
                CustomMessageBox.Show(MessageBoxButtons.OK, "확인", "문제가 발생했습니다.\n 로그를 확인하세요.");
            }
        }
示例#24
0
        /// <summary>
        /// 텍스트박스 입력 키 제한,엔터키 입력시 TAB키 반환
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void TextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            TextBox     txt  = (TextBox)sender;
            Control     temp = txt.Parent;
            MaskTextBox mtb  = null;

            while (temp.Parent != null)
            {
                if (temp is MaskTextBox)
                {
                    mtb = temp as MaskTextBox;
                    break;
                }
                temp = temp.Parent;
            }
            if (mtb == null)
            {
                return;
            }

            switch (mtb.Name)
            {
            case "txtVenderID":
                CommonFuction.TypingOnlyEngNum(sender, e, txtVenderID);
                if (e.KeyChar == (char)Keys.Enter)
                {
                    SendKeys.Send("{TAB}");
                }
                break;

            case "txtVenderName":
                if (Char.IsLetter(e.KeyChar) == false && Char.IsDigit(e.KeyChar) == false && e.KeyChar != 8 && e.KeyChar == ',')
                {
                    e.Handled = true;
                }
                if (e.KeyChar == (char)Keys.Enter)
                {
                    SendKeys.Send("{TAB}");
                }
                break;
            }
        }
示例#25
0
        private void DurableProdTabPageControl_Load(object sender, EventArgs e)
        {
            this.ActiveControl = txtProdId;
            CommonFuction.SetUseYNList(ref cbbUseYn);
            txtVender.ucReadOnly = true;

            try
            {
                sql = "SelectDURABLEPRODUCT";
                db.Open();
                Dictionary <string, object> param = new Dictionary <string, object>();
                dtgDurableProd.DataSource = db.ExecuteProcedure(sql, param);
                DataGridViewProperties();
            }
            catch (Exception ee)
            {
                LogFactory.Log(ee);
                CustomMessageBox.Show(MessageBoxButtons.OK, "확인", "문제가 발생했습니다.\n 로그를 확인하세요.");
            }
        }
示例#26
0
        /// <summary>
        /// 콤보박스 아이템 세팅
        /// </summary>
        private void SetComboBox()
        {
            CommonFuction.SetInputResultList(ref mcbmbInputResult);
            EmptyEquipList = CommonFuction.GetEmptyEquipList();
            ModelCodeList  = CommonFuction.ModelCodeList();

            if (EmptyEquipList.Count > 0)
            {
                mcbmRack.ucComboBoxDataSource   = EmptyEquipList;
                mcbmRack.cboCombo.SelectedIndex = -1;

                mcmbModelCode.ucComboBoxDataSource   = ModelCodeList;
                mcmbModelCode.cboCombo.SelectedIndex = -1;
            }
            else
            {
                CustomMessageBox.Show(MessageBoxButtons.OK, "확인", "현재 비어있는 보관함이 없어 신규 Mask를 생성 할 수 없습니다.");
                btnNew.Enabled = false;
            }
        }
示例#27
0
        private void BtnLogIn_Click(object sender, EventArgs e)
        {
            MMCodeHelper CodeHelper = new MMCodeHelper("LOGIN");

            CodeHelper.WindowState = FormWindowState.Normal;
            CodeHelper.ShowDialog();
            Program.CurrentUser = CodeHelper.ReturnCodeValue;

            //2O19-05-15 황지희 관리자인 경우만 DB관리 버튼 VISIBLE 되도록수정
            if (Program.CurrentUser.Equals("testadmin"))
            {
                lblCrrUser.Text = CodeHelper.ReturnNameValue;
                btnDB.Visible   = true;
            }
            else
            {
                //2019-05-14 황지희 사용자 이름으로 보여주게 변경
                lblCrrUser.Text = CommonFuction.GetUserName(Program.CurrentUser);
                btnDB.Visible   = false;
            }
        }
示例#28
0
 /// <summary>
 /// 버튼의 이벤트들이 발생된 후 각각의 컨트롤러의 텍스트들을 초기화 해주는 함수
 /// </summary>
 public void MakeEmpty()
 {
     CommonFuction.SetUseYNList(ref cbbUseYn);
     foreach (Control ctrl in groupBox1.Controls)
     {
         if (ctrl is UserControls.MaskTextBox)
         {
             UserControls.MaskTextBox tb = (UserControls.MaskTextBox)ctrl;
             if (string.IsNullOrWhiteSpace(tb.ucValue) == false)
             {
                 tb.ucValue = string.Empty;
             }
         }
         if (ctrl is MaskCodeHelper)
         {
             MaskCodeHelper ch = (MaskCodeHelper)ctrl;
             if (string.IsNullOrWhiteSpace(ch.ucValue) == false)
             {
                 ch.ucValue = string.Empty;
             }
         }
     }
 }
示例#29
0
        private void SaveData()
        {
            string ctrlname = "";
            bool   chkMand  = CommonFuction.CheckMandatory(groupBox1, ref ctrlname);

            if (!chkMand)
            {
                return;
            }

            StringBuilder sBuilder = new StringBuilder();

            sBuilder.Append("Data Source=");
            sBuilder.Append(mtxtIP.ucValue);
            sBuilder.Append("; initial Catalog=");
            sBuilder.Append(mtxtCatalog.ucValue);
            sBuilder.Append("; user="******"; password="******"DBConnectionString", sBuilder.ToString());
        }
示例#30
0
        private void SaveCleanResult()
        {
            //2019-04-30 필수 입력값 확인
            string ctrlname = "";

            if (CommonFuction.CheckMandatory(grbox_1, ref ctrlname) == false)
            {
                CustomMessageBox.Show(MessageBoxButtons.OK, "ERROR", $"{ctrlname} 항목을 확인해주세요.");
                return;
            }

            if (CustomMessageBox.Show(MessageBoxButtons.OKCancel, "확인", "저장하시겠습니까?") == DialogResult.OK)
            {
                Dictionary <string, object> Params = new Dictionary <string, object>();
                Params.Add("@durableid", this.txt_MaskNum.ucValue);         //Mask 일련번호
                Params.Add("@durableproductid", this.txt_MaskProd.ucValue); //모델명
                Params.Add("@cleanresult", this.cmb_InspResult.ucValue);
                //Params.Add("@cleandate", DateTime.Now);           //최근사용일자
                Params.Add("@comment", this.txt_MaskProdName.ucValue);     //사양 정보
                Params.Add("@modifier", Program.CurrentUser);              //수정자
                Params.Add("@workstate", "WORKSTATE_WAIT");                //작업 상태
                //2019-08-23 적치대 콤보 추가
                Params.Add("@Rackid", this.mtxt_rack.ucValue);
                var PamasArr = DB.GetSqlParameters(Params);

                int SaveResult = DB.CallNonSelectProcedure("SaveCleanInsp", PamasArr);

                if (SaveResult > 0)
                {
                    CustomMessageBox.Show(MessageBoxButtons.OK, "SAVE", "저장하였습니다.");
                    InitReset();
                    //2019-05-08 저장후 Mask 일련번호로 포커싱 추가
                    txt_MaskNum.Focus();
                    resetRack.ResetRackStatus(true);
                }
            }
        }