Exemple #1
0
        void btnLoadExceldata_Click(object sender, EventArgs e)
        {
            Common.ShowStatus("Đang import dữ liệu chấm công");
            DataTable dt = new DataTable();
            DataSet   ds = new DataSet();

            if (dtImportExcel == null)
            {
                EpointMessage.MsgOk("Không thể đọc dữ liệu");
                return;
            }
            System.Data.SqlClient.SqlCommand sqlcomm = SQLExec.GetSQLCommand();
            sqlcomm.CommandText = "pr_HRM_Importdata";
            sqlcomm.CommandType = CommandType.StoredProcedure;

            sqlcomm.Parameters.AddWithValue("@Ma_Dvcs", Element.sysMa_DvCs);
            sqlcomm.Parameters.AddWithValue("@FileName", "");
            sqlcomm.Parameters.AddWithValue("@SheetName", "");
            sqlcomm.Parameters.AddWithValue("@Create_Log", Common.GetCurrent_Log());

            //Add tham số bảng
            System.Data.SqlClient.SqlParameter para = new System.Data.SqlClient.SqlParameter();
            para           = sqlcomm.Parameters.AddWithValue("@ImportData", dtImportExcel);
            para.SqlDbType = SqlDbType.Structured;

            para.TypeName = "dbo.ImportData";
            //sqlcomm.ExecuteNonQuery();
            System.Data.SqlClient.SqlDataAdapter sqlda = new System.Data.SqlClient.SqlDataAdapter(sqlcomm);
            sqlda.Fill(ds);
            Common.EndShowStatus();
            EpointMessage.MsgOk("Import dữ liệu thành công!");
        }
Exemple #2
0
        public static bool UpdateDuDauINNTXT(frmOpening_Edit frmEdit)
        {
            if ((string)frmEdit.drEdit["Stt"] == string.Empty)
            {
                return(false);
            }

            if (!DataTool.SQLUpdate(frmEdit.enuNew_Edit, "INDUDAUNTXT", ref frmEdit.drEdit))
            {
                return(false);
            }

            //Luu vao Queue
            bool bSaveQueue = false;

            if (bSaveQueue)
            {
                string strStt    = (string)frmEdit.drEdit["Stt"];
                string strSpExec = "SP_CDV_UPDATE_THEKHO '" + strStt + "'";

                if (frmEdit.enuNew_Edit == enuEdit.Edit)
                {
                    SQLExec.Execute("DELETE FROM SYSQUEUE WHERE Stt = '" + strStt + "'");
                }

                Common.SQLPushQueue(SQLExec.GetSQLCommand(), strSpExec, strStt);
            }

            return(true);
        }