Ejemplo n.º 1
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            if (cmb_modelcode.Text == "" || tv_line.Nodes[0].Nodes.Count < 1)
            {
                return;
            }
            string sqldelete = "delete from m_model_line where modelcode = '" + cmb_modelcode.Text + "'";
            sqlCON connect   = new sqlCON();

            connect.sqlExecuteNonQuery(sqldelete, false); //false không xuất hiện thông báo
            for (int i = 0; i < tv_line.Nodes[0].Nodes.Count; i++)
            {
                //if (tv_line.Nodes[0].Nodes[i].Checked)
                //{
                //    MessageBox.Show(tv_line.Nodes[0].Nodes[i].Text);
                //}

                string sqladd = @"insert into m_model_line(modelcode, linecode, status, datetimeRST) values ('"
                                + cmb_modelcode.Text + "','" + tv_line.Nodes[0].Nodes[i].Text + "','"
                                + tv_line.Nodes[0].Nodes[i].Checked.ToString() + "',GETDATE())";
                connect.sqlExecuteNonQuery(sqladd, false);
            }
            infomesge infor = new infomesge();

            infor.WarningMesger("Update is Ok", "INFO", this);
            getdgvfull(cmb_modelcode.Text);
        }
Ejemplo n.º 2
0
        public bool InsertToMQCMES_Realtime(string QRMES, string QRID, string line, string item, string data, string Remark)
        {
            try
            {
                string datetimeserno = DateTime.Now.ToString("yyyyMMdd_HHmmss");
                string serno         = QRMES;
                string site          = "B01";
                string factory       = "TECHLINK";
                string process       = "MQC";

                string status    = "";
                string date_     = DateTime.Now.ToString("yyyy-MM-dd");
                string time_     = DateTime.Now.ToString("HH:mm:ss");
                string sqlQuerry = "";

                // string model = GetModelFromLot(lot,setting);
                QRMQC_MES qRMQC_MES = QRSpilittoClass.QRstring2MQCFormat(QRMES);
                QRIDMES   qRIDMES   = QRSpilittoClass.QRstring2IDFormat(QRID);
                sqlQuerry += "insert into m_ERPMQC_REALTIME (serno, lot, model, site, factory, line, process,item,inspectdate,inspecttime, data, judge,status,remark ) values( '";
                sqlQuerry += serno + "', '" + qRMQC_MES.PO + "', '" + qRMQC_MES.Product + "', '" + site + "', '" + factory + "', '" + line +
                             "', '" + process + "', '" + item + "', '" + date_ + "', '" + time_ + "', '" + data + "', '" + qRIDMES.ID + "', '" + status + "', '" + Remark + "' )";
                sqlCON localPLC = new sqlCON();
                return(localPLC.sqlExecuteNonQuery(sqlQuerry, false));
            }
            catch (Exception ex)
            {
                SystemLog.Output(SystemLog.MSG_TYPE.Err, "InsertToMQC_Realtime(string lot, string line, string item, string data, string Remark, int judge)", ex.Message);
                return(false);
            }
        }
        public bool UpdateBuyerInfor(DataTable dtRowUpdate)
        {
            try
            {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append(" update t_TL_Shipment ");
                stringBuilder.Append(" set ShipmentType = '" + dtRowUpdate.Rows[0]["ShipmentType"] + "' , ");
                stringBuilder.Append(" ShipmentInfor1 = '" + dtRowUpdate.Rows[0]["ShipmentInfor1"] + "' , ");
                stringBuilder.Append(" ShipmentInfor2 = '" + dtRowUpdate.Rows[0]["ShipmentInfor2"] + "', ");
                stringBuilder.Append(" Date_Update = '" + DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "' ");
                stringBuilder.Append(" where ShipmentCode = '" + dtRowUpdate.Rows[0]["ShipmentCode"] + "' ");

                sqlCON sqlCON = new sqlCON();
                var    update = sqlCON.sqlExecuteNonQuery(stringBuilder.ToString(), false);
                if (update == false)
                {
                    SystemLog.Output(SystemLog.MSG_TYPE.Err, "UpdateBuyerInfor(DataTable dtRowUpdate)", "false");
                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                SystemLog.Output(SystemLog.MSG_TYPE.Err, "UpdateBuyerInfor(DataTable dtRowUpdate)", ex.Message);
                return(false);
            }
        }
 public bool UpdateLanguageSetting(LanguageClass language)
 {
     try
     {
         string        user          = Class.valiballecommon.GetStorage().UserName;
         string        CreateDate    = DateTime.Now.ToString("yyyyMMdd");
         string        PC            = Class.valiballecommon.GetStorage().PCName;
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append(" update t_language ");
         stringBuilder.Append(" set  Modifier = '" + user + "' , ");
         stringBuilder.Append("  Modify_Date = '" + CreateDate + "' , ");
         stringBuilder.Append("  Modify_App = '" + PC + "', ");
         stringBuilder.Append("  TiengViet = '" + language.Tiengviet + "', ");
         stringBuilder.Append("  English = '" + language.English + "', ");
         stringBuilder.Append("  Chinese = '" + language.Chinese + "' ");
         stringBuilder.Append(" where 1=1 ");
         stringBuilder.Append(" and  FunctionGroup = '" + language.functionGroup + "' ");
         stringBuilder.Append(" and  FunctionName = '" + language.functionName + "' ");
         sqlCON sqlCON = new sqlCON();
         return(sqlCON.sqlExecuteNonQuery(stringBuilder.ToString(), false));
     }
     catch (Exception ex)
     {
         SystemLog.Output(SystemLog.MSG_TYPE.Err, "UpdateLanguageSetting(LanguageClass language)", ex.Message);
         return(false);
     }
 }
Ejemplo n.º 5
0
 public bool UpdateExportWarehouse(DataTable dtExport, string ERPCode)
 {
     try
     {
         for (int i = 0; i < dtExport.Rows.Count; i++)
         {
             StringBuilder stringBuilder = new StringBuilder();
             stringBuilder.Append(" update t_ExportFGoods ");
             stringBuilder.Append(" set ExportFlag = '" + "Y" + "', ");
             stringBuilder.Append("  TL212 = '" + Class.valiballecommon.GetStorage().DBERP + "', ");
             stringBuilder.Append("  TL213 = '" + ERPCode + "', ");
             stringBuilder.Append(" dateExport = '" + DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "' ");
             stringBuilder.Append(" where KeyID ='" + dtExport.Rows[i]["KeyID"].ToString() + "' ");
             stringBuilder.Append(" and KeyNo ='" + dtExport.Rows[i]["KeyNo"].ToString() + "' ");
             stringBuilder.Append(" and STT ='" + dtExport.Rows[i]["STT"].ToString() + "' ");
             sqlCON sqlCON = new sqlCON();
             var    update = sqlCON.sqlExecuteNonQuery(stringBuilder.ToString(), false);
             if (update == false)
             {
                 SystemLog.Output(SystemLog.MSG_TYPE.Err, "Update Flag Import finished goods fail!", "");
                 return(false);
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         SystemLog.Output(SystemLog.MSG_TYPE.Err, "UpdateImportWarehouse(DataTable dtOutPQC)", ex.Message);
         return(false);
     }
 }
Ejemplo n.º 6
0
        public bool InsertToMQC_Realtime(string lot, string line, string item, string data, string Remark, int judge)
        {
            try
            {
                string datetimeserno = DateTime.Now.ToString("yyyyMMdd_HHmmss");
                string serno         = lot + "-" + datetimeserno;
                string site          = "B01";
                string factory       = "TECHLINK";
                string process       = "MQC";

                string status    = "";
                string date_     = DateTime.Now.ToString("yyyy-MM-dd");
                string time_     = DateTime.Now.ToString("HH:mm:ss");
                string sqlQuerry = "";

                string model = GetModelFromLot(lot);
                sqlQuerry += "insert into m_ERPMQC_REALTIME (serno, lot, model, site, factory, line, process,item,inspectdate,inspecttime, data, judge,status,remark ) values( '";
                sqlQuerry += serno + "', '" + lot + "', '" + model + "', '" + site + "', '" + factory + "', '" + line +
                             "', '" + process + "', '" + item + "', '" + date_ + "', '" + time_ + "', '" + data + "', '" + judge.ToString() + "', '" + status + "', '" + Remark + "' )";
                sqlCON sqlCON = new sqlCON();
                return(sqlCON.sqlExecuteNonQuery(sqlQuerry, false));
            }
            catch (Exception ex)
            {
                SystemLog.Output(SystemLog.MSG_TYPE.Err, "InsertToMQC_Realtime(string lot, string line, string item, string data, string Remark, int judge)", ex.Message);
                return(false);
            }
        }
 public bool InsertERPOutPQC(WMS.Model.PQCOutStock pQCOutStock)
 {
     try
     {
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append(" insert into t_ERP_OutPQCQR (KeyID,KeyNo,STT,ProductOrder ,Product, Quantity, LotNo, Warehouse, dateCreate, TL111, SubQR) values (");
         stringBuilder.Append(" '" + pQCOutStock.KeyID + "', ");
         stringBuilder.Append(" '" + pQCOutStock.KeyNo + "', ");
         stringBuilder.Append(" '" + pQCOutStock.STT + "', ");
         stringBuilder.Append(" '" + pQCOutStock.ProductOrder + "', ");
         stringBuilder.Append(" '" + pQCOutStock.Product + "', ");
         stringBuilder.Append(" '" + pQCOutStock.Quantity + "', ");
         stringBuilder.Append(" '" + pQCOutStock.LotNo + "', ");
         stringBuilder.Append(" '" + pQCOutStock.Warehouse + "', ");
         stringBuilder.Append(" " + "GETDATE()" + ", ");
         stringBuilder.Append(" '" + Class.valiballecommon.GetStorage().DBERP + "', ");
         stringBuilder.Append(" '" + pQCOutStock.QRcodeGenarate + "') ");
         sqlCON sqlCON = new sqlCON();
         return(sqlCON.sqlExecuteNonQuery(stringBuilder.ToString(), false));
     }
     catch (Exception ex)
     {
         SystemLog.Output(SystemLog.MSG_TYPE.Err, "InsertERPOutPQC(WMS.Model.PQCOutStock pQCOutStock)", ex.Message);
     }
     return(false);
 }
 private void btn_app_Click(object sender, EventArgs e)
 {
     if (CheckNull() && keycheck() == false)
     {
         try
         {
             StringBuilder sqladd = new StringBuilder();
             sqladd.Append("insert into t_ERP_planning(deptcode, datetime_planning,type,production_code,output_taget,ng_taget,  datetimeRST) values('");
             sqladd.Append(cmb_dept.Text + "','");
             sqladd.Append(dtp_dateplaning.Value + "','");
             sqladd.Append(cmb_type.Text + "','");
             sqladd.Append(cmb_productioncode.Text + "','");
             sqladd.Append(txt_tagetoutput.Text + "','");
             sqladd.Append(txt_tagetNG.Text + "',");
             sqladd.Append("GETDATE())");
             sqlCON add = new sqlCON();
             add.sqlExecuteNonQuery(sqladd.ToString(), true);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
     btn_search_Click(sender, e);
 }
        void updatedata()
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("insert into t_OCTA(TA01, TA02, TA03, TA04,UserName, datetimeRST) values('" + cmb_TA001.Text + "','" + cmb_TA002.Text + "','" + cmb_TC001.Text + "','" + cmb_TC002.Text + "','" + Class.valiballecommon.GetStorage().UserName + "',GETDATE())");
            sqlCON con = new sqlCON();

            con.sqlExecuteNonQuery(sql.ToString(), true);
        }
        private void Btn_confirm_Click(object sender, EventArgs e)
        {
            sqlCON connect = new sqlCON();

            string sqladd = @"insert into t_report_schedule (reportname, reporttype, Minutes,hours, day, date,month,isBodyHTML, subject, attach,comments,inputdate) values ('"
                            + txt_ReportName.Text + "','" + cmb_typeReport.Text + "','" + nmr_Minutes.Value.ToString() + "','"
                            + nmr_hours.Value.ToString() + "','" + cmb_day.Text + "','" + nmr_date.Value.ToString() + "','" + cmb_month.Text + "','" + rtb_IsBodyHTML.Checked.ToString() + "','" + txt_subject.Text + "','" + txt_attach.Text + "','" + rtb_comment.Text + "',GETDATE())";

            connect.sqlExecuteNonQuery(sqladd, false);
            this.Close();
        }
 public bool InsertToBOMSettingTableIntilizer(List <SettingBOM> settingBOMs)
 {
     foreach (var item in settingBOMs)
     {
         string sqlQuerry = "";
         sqlQuerry += "insert into t_settingBOM (productName, productNo, QTyinBox, QtyTool, Update_Date ) values( '";
         sqlQuerry += item.ProductName + "', '" + item.ProductNo + "', '" + item.QtyInBox + "', '" + item.QtyTool + "',GETDATE() )";
         sqlCON sqlCON = new sqlCON();
         sqlCON.sqlExecuteNonQuery(sqlQuerry, false);
     }
     return(true);
 }
Ejemplo n.º 12
0
 private void btn_delete_Click(object sender, EventArgs e)
 {
     if (dgv_show.RowCount > 0)
     {
         int    rownumber = dgv_show.SelectedCells[0].RowIndex;
         string ID        = dgv_show.Rows[rownumber].Cells[0].Value.ToString();
         string sql       = "delete from m_email where id = '" + ID + "'";
         sqlCON connect   = new sqlCON();
         connect.sqlExecuteNonQuery(sql, true);
         searchdata(ref dgv_show, true);
     }
 }
Ejemplo n.º 13
0
 private void btn_delete_Click(object sender, EventArgs e)
 {
     if (dgv_ip.RowCount > 0)
     {
         int    rownumber = dgv_ip.SelectedCells[0].RowIndex;
         string ip        = dgv_ip.Rows[rownumber].Cells[5].Value.ToString();
         string sql       = "delete from m_ipPLC where IPPLC = '" + ip + "'";
         sqlCON connect   = new sqlCON();
         connect.sqlExecuteNonQuery(sql, true);
         searchdata(ref dgv_ip, true);
     }
 }
Ejemplo n.º 14
0
 private void btn_delete_Click(object sender, EventArgs e)
 {
     if (dgv_dept.RowCount > 0)
     {
         int    rownumber = dgv_dept.SelectedCells[0].RowIndex;
         string deptcode  = dgv_dept.Rows[rownumber].Cells[1].Value.ToString();
         string sql       = "delete from m_dept where deptcode = '" + deptcode + "'";
         sqlCON connect   = new sqlCON();
         connect.sqlExecuteNonQuery(sql, true);
         searchdata(ref dgv_dept, true);
     }
 }
 private void btn_delete_Click(object sender, EventArgs e)
 {
     if (dgv_process.RowCount > 0)
     {
         int    rownumber = dgv_process.SelectedCells[0].RowIndex;
         string id        = dgv_process.Rows[rownumber].Cells[0].Value.ToString();
         string sql       = "delete from m_process where id = " + id + "";
         sqlCON connect   = new sqlCON();
         connect.sqlExecuteNonQuery(sql, true);
         searchdata(ref dgv_process, true);
     }
 }
        private void btn_ok_Click(object sender, EventArgs e)
        {
            if (checkdata() == false)
            {
                return;
            }

            string sql     = "update m_user set password ='******' where usercode = '" + Class.valiballecommon.GetStorage().UserCode + "'";
            sqlCON connect = new sqlCON();

            connect.sqlExecuteNonQuery(sql, true);
        }
 public bool InsertToManufactureSettingTableIntilizer(List <SettingBOM> settingBOMs)
 {
     foreach (var item in settingBOMs)
     {
         string sqlQuerry = "";
         sqlQuerry += "insert into t_settingManufacture (productName, productNo, PlanQuantity, WorkerTarget, Update_Date ) values( '";
         sqlQuerry += item.ProductName + "', '" + item.ProductNo + "', '" + 0 + "', '" + 0 + "',GETDATE() )";
         sqlCON sqlCON = new sqlCON();
         sqlCON.sqlExecuteNonQuery(sqlQuerry, false);
     }
     return(true);
 }
        private void btn_update_Click(object sender, EventArgs e)
        {
            if (cmb_permission.Text == "" || dgv_permission.Rows.Count < 1)
            {
                return;
            }
            string sqldelete = "delete from m_permission where permission = '" + cmb_permission.Text + "' and permission not like 'admin'";
            sqlCON connect   = new sqlCON();

            connect.sqlExecuteNonQuery(sqldelete, false); //false không xuất hiện thông báo
            for (int i = 0; i < dgv_permission.Rows.Count; i++)
            {
                string sqladd = @"insert into m_permission(permission, button, status, datetimeRST) values ('"
                                + cmb_permission.Text + "','" + dgv_permission.Rows[i].Cells[0].Value.ToString() + "','"
                                + dgv_permission.Rows[i].Cells[1].Value.ToString() + "',GETDATE())";
                connect.sqlExecuteNonQuery(sqladd, false);
            }

            infomesge infor = new infomesge();

            infor.WarningMesger("Update is Ok", "INFO", this);
            getdgvfull(cmb_permission.Text);
        }
 public bool DeleteRowofManufaccture(string productNo)
 {
     try
     {
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append(" delete from  t_settingManufacture");
         stringBuilder.Append(" where  productNo = '" + productNo + "'");
         sqlCON sqlCON = new sqlCON();
         return(sqlCON.sqlExecuteNonQuery(stringBuilder.ToString(), false));
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public bool InsertRowofProduct(string productname, string productNo, int QtyBox, int QtyTool)
 {
     try
     {
         string sqlQuerry = "";
         sqlQuerry += "insert into t_settingBOM (productName, productNo, QTyinBox, QtyTool, Update_Date ) values( '";
         sqlQuerry += productname + "', '" + productNo + "', '" + QtyBox + "', '" + QtyTool + "',GETDATE() )";
         sqlCON sqlCON = new sqlCON();
         return(sqlCON.sqlExecuteNonQuery(sqlQuerry, false));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 21
0
 public static void UpdateQRcodeByQR(string QRcode)
 {
     try
     {
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append("update t_QRImport set Status ='1' ");
         stringBuilder.Append(" WHERE IDQRCODE = '" + QRcode.Trim() + "'");
         sqlCON sqlTLVN2 = new sqlCON();
         sqlTLVN2.sqlExecuteNonQuery(stringBuilder.ToString(), false);
     }
     catch (Exception ex)
     {
         SystemLog.Output(SystemLog.MSG_TYPE.Err, "UpdateQRcode", ex.Message);
     }
 }
 public bool InsertRowofManufacture(string productname, string productNo, int PlanQty, int Workertarget)
 {
     try
     {
         string sqlQuerry = "";
         sqlQuerry += "insert into t_settingManufacture (productName, productNo, PlanQuantity, WorkerTarget, Update_Date ) values( '";
         sqlQuerry += productname + "', '" + productNo + "', '" + PlanQty + "', '" + Workertarget + "',GETDATE() )";
         sqlCON sqlCON = new sqlCON();
         return(sqlCON.sqlExecuteNonQuery(sqlQuerry, false));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 23
0
 public bool InsertRowofManufacture(FingerData fingerData)
 {
     try
     {
         string sqlQuerry = "";
         sqlQuerry += "insert into m_FingerData (Dept, IDName,Name, DateTime, TimeIn, TimeOut,DayWorkingTime,NightWorkingtime,ApproveTimeAbsent,Update_datetime ) values( '";
         sqlQuerry += fingerData.Dept + "', '" + fingerData.ID + "', '" + fingerData.Name + "', '" + fingerData.DateTime + "', '" + fingerData.TimeIn + "', '" + fingerData.TimeOut + "', '" + fingerData.DayWorkingTime + "', '" + fingerData.NightWorkingTime + "', '" + fingerData.AproveTimeabsent + "',GETDATE() )";
         sqlCON sqlCON = new sqlCON();
         return(sqlCON.sqlExecuteNonQuery(sqlQuerry, false));
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Ejemplo n.º 24
0
 public bool InsertRowofSpecialList(SpecialList special)
 {
     try
     {
         string sqlQuerry = "";
         sqlQuerry += "insert into m_SpecialList (No, IDName,Name, Department, fromDate, toDate,Status,Update_datetime ) values( '";
         sqlQuerry += special.No + "', '" + special.ID + "', '" + special.Name + "', '" + special.Department + "', '" + special.from + "', '" + special.to + "', '" + special.status + "',GETDATE() )";
         sqlCON sqlCON = new sqlCON();
         return(sqlCON.sqlExecuteNonQuery(sqlQuerry, false));
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
        private void btn_delete_Click(object sender, EventArgs e)
        {
            if (keyid == "")
            {
                return;
            }
            string sqldelete     = @"delete from t_ERP_planning where id  = '" + keyid + "'";
            sqlCON connectdelete = new sqlCON();

            connectdelete.sqlExecuteNonQuery(sqldelete, true);
            infomesge info = new infomesge();

            info.WarningMesger("One Row is deleted !!!", "Deleted OK", this);
            cmb_productioncode.Text = "";
            btn_search_Click(sender, e);
        }
 public bool UpdateToDatabase(string productNo, int QtyinPacking, int QtyTool)
 {
     try
     {
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append(" update t_settingBOM ");
         stringBuilder.Append(" set  QTyinBox = '" + QtyinPacking.ToString() + "' , ");
         stringBuilder.Append("  QtyTool = '" + QtyTool.ToString() + "' ");
         stringBuilder.Append(" where  productNo = '" + productNo + "'");
         sqlCON sqlCON = new sqlCON();
         return(sqlCON.sqlExecuteNonQuery(stringBuilder.ToString(), false));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 27
0
 public static void InsertQRcode(string QR_Code)
 {
     try
     {
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append("insert into t_QRImport (IDQRCODE,Status,Update_Date) values('");
         stringBuilder.Append(QR_Code.Trim() + "',");
         stringBuilder.Append("'" + 1 + "',");
         stringBuilder.Append("'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "')");
         sqlCON sqlTLVN2 = new sqlCON();
         sqlTLVN2.sqlExecuteNonQuery(stringBuilder.ToString(), false);
     }
     catch (Exception ex)
     {
         SystemLog.Output(SystemLog.MSG_TYPE.Err, "InsertQRcode", ex.Message);
     }
 }
 public bool DeleteRowofLanguageSetting(LanguageClass language)
 {
     try
     {
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append(" delete from  t_language ");
         stringBuilder.Append(" where 1=1 ");
         stringBuilder.Append(" and  FunctionGroup = '" + language.functionGroup + "' ");
         stringBuilder.Append(" and  FunctionName = '" + language.functionName + "' ");
         sqlCON sqlCON = new sqlCON();
         return(sqlCON.sqlExecuteNonQuery(stringBuilder.ToString(), false));
     }
     catch (Exception ex)
     {
         SystemLog.Output(SystemLog.MSG_TYPE.Err, "DeleteRowofLanguageSetting(LanguageClass language)", ex.Message);
         return(false);
     }
 }
 public bool UpdateToManufacture(string productNo, int PlanQty, int Workertarget)
 {
     try
     {
         StringBuilder stringBuilder = new StringBuilder();
         stringBuilder.Append(" update t_settingManufacture ");
         stringBuilder.Append(" set PlanQuantity = '" + PlanQty.ToString() + "' , ");
         stringBuilder.Append("  WorkerTarget = '" + Workertarget.ToString() + "' ");
         //    stringBuilder.Append("  Update_Date = 'GETDATE()' ");
         stringBuilder.Append(" where  productNo = '" + productNo + "'");
         sqlCON sqlCON = new sqlCON();
         return(sqlCON.sqlExecuteNonQuery(stringBuilder.ToString(), false));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Ejemplo n.º 30
0
        public bool InsertRowofWorkingDate(WorkingDateData workData)
        {
            try
            {
                string sqlQuerry = "";
                sqlQuerry += "insert into m_WorkingDate ( IDName,Name, Dept,Col_Dept,Col_date,Year,Month,Shift, N1, N2, N3, N4, N5, N6, N7, N8, N9, N10,N11,"
                             + "N12,N13,N14,N15,N16,N17,N18,N19,N20,N21,N22,N23,N24,N25,N26,N27,N28,N29,N30,N31, Update_date ) values ('";
                sqlQuerry += workData.ID + "', '" + workData.Name + "', '" + workData.dept + "', '" + workData.col_Dept + "', '" + workData.col_date + "', '" + "2019" + "', '"
                             + workData.WorkingTimeDatas[0].month + "', '" + "day";

                for (int i = 0; i < workData.WorkingTimeDatas.Count; i++)
                {
                    if (workData.WorkingTimeDatas[i].Shift == "day")
                    {
                        sqlQuerry += "', '" + workData.WorkingTimeDatas[i].workingHour;
                    }
                }
                sqlQuerry += "',GETDATE() )";
                sqlCON sqlCON = new sqlCON();
                sqlCON.sqlExecuteNonQuery(sqlQuerry, false);


                string sqlQuerry2 = "";
                sqlQuerry2 += "insert into m_WorkingDate ( IDName,Name, Dept,Col_Dept,Col_date,Year,Month,Shift, N1, N2, N3, N4, N5, N6, N7, N8, N9, N10,N11,"
                              + "N12,N13,N14,N15,N16,N17,N18,N19,N20,N21,N22,N23,N24,N25,N26,N27,N28,N29,N30,N31, Update_date ) values ('";
                sqlQuerry2 += workData.ID + "', '" + workData.Name + "', '" + workData.dept + "', '" + workData.col_Dept + "', '" + workData.col_date + "', '" + "2019" + "', '"
                              + workData.WorkingTimeDatas[0].month + "', '" + "night";

                for (int i = 0; i < workData.WorkingTimeDatas.Count; i++)
                {
                    if (workData.WorkingTimeDatas[i].Shift == "night")
                    {
                        sqlQuerry2 += "', '" + workData.WorkingTimeDatas[i].workingHour;
                    }
                }
                sqlQuerry2 += "',GETDATE() )";
                sqlCON sqlCON2 = new sqlCON();
                return(sqlCON2.sqlExecuteNonQuery(sqlQuerry2, false));
            }
            catch (Exception ex)
            {
                return(false);
            }
        }